diff -ur -x.svn ffmpeg.orig/configure ffmpeg/configure
--- ffmpeg.orig/configure	Fri Jun  4 12:57:54 2010
+++ ffmpeg/configure	Fri Jun  4 12:59:11 2010
@@ -2556,6 +2556,9 @@
         add_extralibs -pthreads
     elif check_func pthread_create -lpthreadGC2; then
         add_extralibs -lpthreadGC2
+    elif check_func pthread_create -lpthread -lws2_32; then
+        add_cflags -DPTW32_STATIC_LIB
+        add_extralibs -lpthread -lws2_32
     elif ! check_lib pthread.h pthread_create -lpthread; then
         die "ERROR: can't find pthreads library"
     fi
@@ -2591,13 +2594,13 @@
                       require  libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
 enabled libfaad    && require2 libfaad faad.h faacDecOpen -lfaad
-enabled libgsm     && require  libgsm gsm/gsm.h gsm_create -lgsm
+enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
 enabled libmp3lame && require  libmp3lame lame/lame.h lame_init -lmp3lame -lm
 enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
 enabled libopencore_amrnb  && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
 enabled libopencore_amrwb  && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm
 enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
-enabled librtmp    && require  librtmp librtmp/rtmp.h RTMP_Init $(pkg-config --libs librtmp)
+enabled librtmp    && require  librtmp librtmp/rtmp.h RTMP_Init -lrtmp -lssl -lcrypto -lwinmm -lws2_32 -lgdi32 -lz
 enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
                            require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
 enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
@@ -2605,10 +2608,10 @@
 enabled libvorbis  && require  libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
 enabled libvpx     && require2 libvpx "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver" -lvpx &&
                       require2 libvpx "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver" -lvpx
-enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 -lm &&
+enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 -lm -lpthread -lws2_32 &&
                       { check_cpp_condition x264.h "X264_BUILD >= 98" ||
                         die "ERROR: libx264 version must be >= 0.98."; }
-enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
+enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore -lpthread -lws2_32
 enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
 
 # libdc1394 check
diff -ur -x.svn ffmpeg.orig/ffmpeg.c ffmpeg/ffmpeg.c
--- ffmpeg.orig/ffmpeg.c	Fri Jun  4 12:57:54 2010
+++ ffmpeg/ffmpeg.c	Fri Jun  4 12:59:11 2010
@@ -1705,7 +1705,7 @@
                             do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size);
                             break;
                         case AVMEDIA_TYPE_VIDEO:
-#if CONFIG_AVFILTER
+#if CONFIG_AVFILTER && !CONFIG_LIBXVID_ENCODER
                             ost->st->codec->sample_aspect_ratio = ist->picref->pixel_aspect;
 #endif
                             do_video_out(os, ost, ist, &picture, &frame_size);
@@ -2100,6 +2100,7 @@
                                 ost->source_index = j;
                                 found = 1;
                             }
+                            break;
                         }
                     }
 
diff -ur -x.svn ffmpeg.orig/libavcodec/libgsm.c ffmpeg/libavcodec/libgsm.c
--- ffmpeg.orig/libavcodec/libgsm.c	Fri Jun  4 12:52:22 2010
+++ ffmpeg/libavcodec/libgsm.c	Fri Apr 23 07:19:29 2010
@@ -28,7 +28,7 @@
 // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
 
 #include "avcodec.h"
-#include <gsm/gsm.h>
+#include <gsm.h>
 
 // gsm.h misses some essential constants
 #define GSM_BLOCK_SIZE 33
diff -ur -x.svn ffmpeg.orig/libavcodec/opt.c ffmpeg/libavcodec/opt.c
--- ffmpeg.orig/libavcodec/opt.c	Fri Jun  4 12:52:23 2010
+++ ffmpeg/libavcodec/opt.c	Fri Jun  4 12:46:21 2010
@@ -175,6 +175,7 @@
             if(o->type == FF_OPT_TYPE_FLAGS){
                 if     (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;
                 else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;
+                else if(buf[0]=='0' && buf[1]=='x') d= strtoul(buf, NULL, 16);
             }else{
                 if     (cmd=='+') d= notfirst*av_get_double(obj, name, NULL) + d;
                 else if(cmd=='-') d= notfirst*av_get_double(obj, name, NULL) - d;
diff -ur -x.svn ffmpeg.orig/libavformat/rmdec.c ffmpeg/libavformat/rmdec.c
--- ffmpeg.orig/libavformat/rmdec.c	Fri Jun  4 12:57:53 2010
+++ ffmpeg/libavformat/rmdec.c	Fri Jun  4 12:46:43 2010
@@ -305,7 +305,7 @@
             return ret;
 
 //        av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
-        st->codec->time_base.den = fps * st->codec->time_base.num;
+        st->codec->time_base.den = fps2 * st->codec->time_base.num;
         //XXX: do we really need that?
         switch(st->codec->extradata[4]>>4){
         case 1: st->codec->codec_id = CODEC_ID_RV10; break;
diff -ur -x.svn ffmpeg.orig/libavformat/rtsp.c ffmpeg/libavformat/rtsp.c
--- ffmpeg.orig/libavformat/rtsp.c	Fri Jun  4 12:57:53 2010
+++ ffmpeg/libavformat/rtsp.c	Fri Jun  4 12:46:42 2010
@@ -1736,6 +1736,10 @@
     return 0;
 }
 
+#ifdef WIN32
+#define ETIMEDOUT WSAETIMEDOUT
+#endif
+
 static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
                            uint8_t *buf, int buf_size)
 {
