diff --git a/configure b/configure
index 19b2442f81013474ff5e2f241861b0495658b7bc..c4805465dab4d0eb1c54f6d1031799f199d115f6 100755
--- a/configure
+++ b/configure
@@ -870,7 +870,6 @@ elif test "$cpu" = "powerpc" ; then
 elif test "$cpu" = "mips" ; then
   echo "TARGET_ARCH_MIPS=yes" >> config.mak
   echo "#define ARCH_MIPS 1" >> $TMPH
-fi
 elif test "$cpu" = "sh4" ; then
   echo "TARGET_ARCH_SH4=yes" >> config.mak
   echo "#define ARCH_SH4 1" >> $TMPH
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 889c3147ae6048ed316877cda430bdbaf0abb763..e0f87c7c583d144a0f63b6ef11c2f5865063b7c0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -455,7 +455,10 @@ typedef struct AVCodecContext {
 
     /**
      * pixel format, see PIX_FMT_xxx.
-     * - encoding: unused
+     * - encoding: FIXME: used by ffmpeg to decide whether an pix_fmt
+     *                    conversion is in order. This only works for
+     *                    codecs with one supported pix_fmt, we should
+     *                    do something for a generic case as well.
      * - decoding: set by lavc.
      */
     enum PixelFormat pix_fmt;
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index f15b336d2bf658a70c213050112371e9ff7d1d2f..c9884d321b9e70a86ea6850b93185b7d372dfe94 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2035,7 +2035,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
     Mpeg1Context *s1 = avctx->priv_data;
     MpegEncContext *s = &s1->mpeg_enc_ctx;
        
-    if (!s1->mpeg_enc_ctx_allocated)
+    if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
         return 0;
 
 #ifdef HAVE_XVMC
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 91b46b2b687aa2680d1bc3943f8bd86a3639079f..b84875f43e1a13d2338d00156e47d3fb928554a4 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -540,6 +540,8 @@ int MPV_encode_init(AVCodecContext *avctx)
     int i;
     int chroma_h_shift, chroma_v_shift;
 
+    avctx->pix_fmt = PIX_FMT_YUV420P; // FIXME
+
     s->bit_rate = avctx->bit_rate;
     s->bit_rate_tolerance = avctx->bit_rate_tolerance;
     s->width = avctx->width;
@@ -1515,6 +1517,7 @@ static void select_input_picture(MpegEncContext *s){
             pic->quality   = s->reordered_input_picture[0]->quality;
             pic->coded_picture_number = s->reordered_input_picture[0]->coded_picture_number;
             pic->reference = s->reordered_input_picture[0]->reference;
+	    pic->pts = s->reordered_input_picture[0]->pts;
             
             alloc_picture(s, pic, 0);
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 69e3ef2832719b3a888634f3aab18a1ad17596a3..e898e40f21552712226e21963875cbe3fd0e8683 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -6,7 +6,7 @@ include ../config.mak
 
 VPATH=$(SRC_PATH)/libavformat
 
-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -Werror
+CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 
 OBJS= utils.o cutils.o allformats.o
 PPOBJS=