diff -ur -x.svn ffmpeg/configure ../ffmpeg/configure
--- ffmpeg/configure	Mon Sep 27 18:53:50 2010
+++ ../ffmpeg/configure	Mon Sep 27 18:42:42 2010
@@ -2708,6 +2708,9 @@
         add_extralibs -pthreads
     elif check_func pthread_create -lpthreadGC2; then
         add_extralibs -lpthreadGC2
+    elif check_func pthread_create -lpthread; then
+        add_cflags -DPTW32_STATIC_LIB
+        add_extralibs -lpthread
     elif ! check_lib pthread.h pthread_create -lpthread; then
         disable pthreads
     fi
@@ -2743,15 +2746,15 @@
                       require  libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) &&
                       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 libgsm     && require  libgsm gsm/gsm.h gsm_create -lgsm
+enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
 enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h hip_decode_init -lmp3lame
 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
 enabled libopencore_amrwb  && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
-enabled libopencv  && { check_lib opencv/cv.h cvCreateImageHeader $(pkg-config --libs opencv) ||
+enabled libopencv  && { check_lib opencv/cv.h cvCreateImageHeader -lcv210 -lcxcore210 -lz -lflann -lopencv_lapack -lstdc++ ||
                         die "ERROR: libopencv not found"; }
 enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
-enabled librtmp    && { check_lib librtmp/rtmp.h RTMP_Socket $(pkg-config --libs librtmp) ||
+enabled librtmp    && { check_lib librtmp/rtmp.h RTMP_Socket -lrtmp -lssl -lcrypto -lwinmm -lws2_32 -lgdi32 -lz ||
                         die "ERROR: librtmp not found or RTMP_Socket() missing, librtmp version must be >= 2.2.f"; }
 enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
                            require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
@@ -2763,11 +2766,11 @@
                                 die "ERROR: libvpx decoder version must be >=0.9.1"; }
     enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx ||
                                 die "ERROR: libvpx encoder version must be >=0.9.1"; } }
-enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 &&
+enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 -lpthread &&
                       { check_cpp_condition x264.h "X264_BUILD >= 98" ||
                         die "ERROR: libx264 version must be >= 0.98."; }
 enabled libxavs    && require  libxavs xavs.h xavs_encoder_encode -lxavs
-enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
+enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore -lpthread
 enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
 
 # libdc1394 check
diff -ur -x.svn ffmpeg/ffmpeg.c ../ffmpeg/ffmpeg.c
--- ffmpeg/ffmpeg.c	Mon Sep 27 18:53:50 2010
+++ ../ffmpeg/ffmpeg.c	Mon Sep 27 18:42:42 2010
@@ -1702,7 +1702,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
                             if (ist->picref->video)
                                 ost->st->codec->sample_aspect_ratio = ist->picref->video->pixel_aspect;
 #endif
@@ -2099,6 +2099,7 @@
                             best_nb_frames= ist->st->codec_info_nb_frames;
                             ost->source_index = j;
                             found = 1;
+                            break;
                         }
                     }
                 }
diff -ur -x.svn ffmpeg/libavcodec/libgsm.c ../ffmpeg/libavcodec/libgsm.c
--- ffmpeg/libavcodec/libgsm.c	Mon Sep 27 18:53:24 2010
+++ ../ffmpeg/libavcodec/libgsm.c	Mon Sep 27 08:53:33 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/libavformat/rmdec.c ../ffmpeg/libavformat/rmdec.c
--- ffmpeg/libavformat/rmdec.c	Mon Sep 27 18:53:48 2010
+++ ../ffmpeg/libavformat/rmdec.c	Mon Sep 27 08:54:26 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/libavformat/rtsp.c ../ffmpeg/libavformat/rtsp.c
--- ffmpeg/libavformat/rtsp.c	Mon Sep 27 18:53:48 2010
+++ ../ffmpeg/libavformat/rtsp.c	Mon Sep 27 08:54:46 2010
@@ -1667,6 +1667,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)
 {
diff -ur -x.svn ffmpeg/libavutil/opt.c ../ffmpeg/libavutil/opt.c
--- ffmpeg/libavutil/opt.c	Mon Sep 27 18:53:00 2010
+++ ../ffmpeg/libavutil/opt.c	Mon Sep 27 18:45:14 2010
@@ -180,6 +180,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;
