diff --git a/configure b/configure
index b92609a..b077cb0 100755
--- a/configure
+++ b/configure
@@ -3140,9 +3140,10 @@ check_mathfunc truncf
 # these are off by default, so fail if requested and not available
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
 enabled frei0r     && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
-enabled gnutls     && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
+enabled gnutls     && { check_lib gnutls/gnutls.h gnutls_global_init -lgnutls -lgcrypt -lgpg-error -lws2_32 ||
+                        check_lib gnutls/gnutls.h gnutls_global_init -lgnutls -lhogweed -lnettle -lgmp -lws2_32 ||
+                        die "ERROR: gnutls not found"; }
 enabled libaacplus && require  "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
-enabled libass     && require_pkg_config libass ass/ass.h ass_library_init
 enabled libbluray  && require libbluray libbluray/bluray.h bd_open -lbluray
 enabled libcelt    && require libcelt celt/celt.h celt_decode -lcelt0 &&
                       { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
@@ -3151,18 +3152,27 @@ enabled libdirac   && require_pkg_config dirac                          \
     "libdirac_decoder/dirac_parser.h"  \
     "dirac_decoder_init"
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
-enabled libgsm     && require  libgsm gsm/gsm.h gsm_create -lgsm
-enabled libmodplug && require  libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
+enabled libfreetype && { add_cflags -I/mingw/include/freetype2 &&
+                         require2 freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType -lfreetype; }
+enabled libass     && require  libass ass/ass.h ass_library_init -lass -lfribidi -lfontconfig -lexpat -liconv
+enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
+enabled libmodplug && require  libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug -lstdc++
 enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -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  && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
+enabled libopencv  && { { add_ldflags -L/mingw/share/opencv/3rdparty/lib &&
+                          check_lib opencv/cxcore.h cvCreateImageHeader -lopencv_imgproc220 -lopencv_core220 -lopencv_lapack -lstdc++; } ||
+                        die "ERROR: libopencv version must be 2.2"; }
 enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
 enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
-enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
-enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
+enabled librtmp    && { check_lib librtmp/rtmp.h RTMP_Socket -lrtmp -lpolarssl -lwinmm -lws2_32 ||
+                        check_lib librtmp/rtmp.h RTMP_Socket -lrtmp -lgnutls -lgcrypt -lgpg-error -lwinmm -lws2_32 ||
+                        check_lib librtmp/rtmp.h RTMP_Socket -lrtmp -lgnutls -lhogweed -lnettle -lgmp -lwinmm -lws2_32 ||
+                        check_lib librtmp/rtmp.h RTMP_Socket -lrtmp -lssl -lcrypto -lwinmm -lws2_32 -lgdi32 ||
+                        die "ERROR: librtmp not found or RTMP_Socket() missing, librtmp version must be >= 2.2.f"; }
+enabled libschroedinger && { add_cflags -I/mingw/include/schroedinger-1.0 &&
+                             require schroedinger-1.0 schroedinger/schro.h schro_init -lschroedinger-1.0 -lorc-0.4; }
 enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
 enabled libstagefright_h264  && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
     media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
diff --git a/ffmpeg.c b/ffmpeg.c
index c43192d..1e73955 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1678,7 +1678,7 @@ static void print_report(OutputFile *output_files,
     int64_t pts = INT64_MAX;
     static int64_t last_time = -1;
     static int qp_histogram[52];
-    int hours, mins, secs, us;
+    //int hours, mins, secs, us;
 
     if (!print_stats && !is_last_report)
         return;
@@ -1759,20 +1759,21 @@ static void print_report(OutputFile *output_files,
                                       ost->st->time_base, AV_TIME_BASE_Q));
     }
 
-    secs = pts / AV_TIME_BASE;
-    us = pts % AV_TIME_BASE;
-    mins = secs / 60;
-    secs %= 60;
-    hours = mins / 60;
-    mins %= 60;
+    //secs = pts / AV_TIME_BASE;
+    //us = pts % AV_TIME_BASE;
+    //mins = secs / 60;
+    //secs %= 60;
+    //hours = mins / 60;
+    //mins %= 60;
 
     bitrate = pts ? total_size * 8 / (pts / 1000.0) : 0;
 
     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-             "size=%8.0fkB time=", total_size / 1024.0);
-    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-             "%02d:%02d:%02d.%02d ", hours, mins, secs,
-             (100 * us) / AV_TIME_BASE);
+             "size=%8.0fkB time=%0.2f ", total_size / 1024.0, (double)pts / AV_TIME_BASE);
+    //         "size=%8.0fkB time=", total_size / 1024.0);
+    //snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+    //         "%02d:%02d:%02d.%02d ", hours, mins, secs,
+    //         (100 * us) / AV_TIME_BASE);
     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
              "bitrate=%6.1fkbits/s", bitrate);
 
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index 1a21455..b0b21c9 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -27,7 +27,7 @@
 
 // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
 
-#include <gsm/gsm.h>
+#include <gsm.h>
 
 #include "avcodec.h"
 #include "gsm.h"
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 5610038..d74048c 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -565,7 +565,7 @@ static const AVOption options[] = {
     { "psy-rd",        "Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.", OFFSET(psy_rd), AV_OPT_TYPE_STRING,  {0 }, 0, 0, VE},
     { "rc-lookahead",  "Number of frames to look ahead for frametype and ratecontrol", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
     { "weightb",       "Weighted prediction for B-frames.",               OFFSET(weightb),       AV_OPT_TYPE_INT,    {-1 }, -1, 1, VE },
-    { "weightp",       "Weighted prediction analysis method.",            OFFSET(weightp),       AV_OPT_TYPE_INT,    {-1 }, -1, INT_MAX, VE, "weightp" },
+    { "weightp",       "Weighted prediction analysis method.",            OFFSET(weightp),       AV_OPT_TYPE_INT,    { 0 }, -1, INT_MAX, VE, "weightp" },
     { "none",          NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_NONE},   INT_MIN, INT_MAX, VE, "weightp" },
     { "simple",        NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" },
     { "smart",         NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SMART},  INT_MIN, INT_MAX, VE, "weightp" },
@@ -610,7 +610,7 @@ static const AVClass rgbclass = {
 
 static const AVCodecDefault x264_defaults[] = {
     { "b",                "0" },
-    { "bf",               "-1" },
+    { "bf",               "0" },
     { "flags2",           "0" },
     { "g",                "-1" },
     { "qmin",             "-1" },
diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
index a77fafc..c7fcb85 100644
--- a/libavcodec/libxvidff.c
+++ b/libavcodec/libxvidff.c
@@ -203,6 +203,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
     xvid_enc_create.num_zones = 0;
 
     xvid_enc_create.num_threads = avctx->thread_count;
+    xvid_enc_create.num_slices = avctx->slices;
 
     xvid_enc_create.plugins = plugins;
     xvid_enc_create.num_plugins = 0;
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 2f8be3b..adbb154 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -195,6 +195,7 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
             read_number(o, dst, NULL, NULL, &intnum);
             if      (cmd == '+') d = intnum | (int64_t)d;
             else if (cmd == '-') d = intnum &~(int64_t)d;
+            else if (buf[0] == '0' && buf[1] == 'x') d = strtoul(buf, NULL, 16);
         } else {
             read_number(o, dst, &num, &den, &intnum);
             if      (cmd == '+') d = notfirst*num*intnum/den + d;
diff --git a/tests/Makefile b/tests/Makefile
index 45ce130..ae1ceac 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -138,7 +138,7 @@ FATE_UTILS = base64 tiny_psnr
 
 TOOL = ffmpeg
 
-fate:: $(FATE)
+fate test:: $(FATE)
 
 $(FATE): $(TOOL)$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
 	@echo "TEST    $(@:fate-%=%)"
