diff --git a/configure b/configure
index fc256b1953..c3783d7201 100755
--- a/configure
+++ b/configure
@@ -5938,7 +5938,7 @@ if ! disabled sdl2; then
     else
       if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
         sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
-        sdl2_libs=$("${SDL2_CONFIG}" --libs)
+        sdl2_libs=$("${SDL2_CONFIG}" --static-libs)
         check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
         check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
         check_func SDL_Init $sdl2_libs $sdl2_cflags && enable sdl2
diff --git a/ffmpeg.c b/ffmpeg.c
index dbfb14bfca..801ea96499 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1756,12 +1756,14 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
             nb_frames_drop += ost->last_dropped;
     }
 
-    secs = FFABS(pts) / AV_TIME_BASE;
-    us = FFABS(pts) % AV_TIME_BASE;
-    mins = secs / 60;
-    secs %= 60;
-    hours = mins / 60;
-    mins %= 60;
+    if (progress_avio) {
+        secs = FFABS(pts) / AV_TIME_BASE;
+        us = FFABS(pts) % AV_TIME_BASE;
+        mins = secs / 60;
+        secs %= 60;
+        hours = mins / 60;
+        mins %= 60;
+    }
 
     bitrate = pts && total_size >= 0 ? total_size * 8 / (pts / 1000.0) : -1;
     speed = t != 0.0 ? (double)pts / AV_TIME_BASE / t : -1;
@@ -1772,9 +1774,13 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
                                  "size=%8.0fkB time=", total_size / 1024.0);
     if (pts < 0)
         snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "-");
-    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-             "%02d:%02d:%02d.%02d ", hours, mins, secs,
-             (100 * us) / AV_TIME_BASE);
+    if (progress_avio)
+        snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+                 "%02d:%02d:%02d.%02d ", hours, mins, secs,
+                 (100 * us) / AV_TIME_BASE);
+    else
+        snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+                 "%0.2f ", (double)pts / AV_TIME_BASE);
 
     if (bitrate < 0) {
         snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),"bitrate=N/A");
@@ -1787,8 +1793,9 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     if (total_size < 0) av_bprintf(&buf_script, "total_size=N/A\n");
     else                av_bprintf(&buf_script, "total_size=%"PRId64"\n", total_size);
     av_bprintf(&buf_script, "out_time_ms=%"PRId64"\n", pts);
-    av_bprintf(&buf_script, "out_time=%02d:%02d:%02d.%06d\n",
-               hours, mins, secs, us);
+    if (progress_avio)
+        av_bprintf(&buf_script, "out_time=%02d:%02d:%02d.%06d\n",
+                   hours, mins, secs, us);
 
     if (nb_frames_dup || nb_frames_drop)
         snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index b11ede6198..302bc3c493 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -541,6 +541,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
         x4->params.i_keyint_max         = avctx->gop_size;
     if (avctx->max_b_frames >= 0)
         x4->params.i_bframe             = avctx->max_b_frames;
+    else
+        x4->params.i_bframe             = 0;
 
 #if FF_API_PRIVATE_OPT
 FF_DISABLE_DEPRECATION_WARNINGS
@@ -630,6 +632,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
         x4->params.rc.i_lookahead = x4->rc_lookahead;
     if (x4->weightp >= 0)
         x4->params.analyse.i_weighted_pred = x4->weightp;
+    else
+        x4->params.analyse.i_weighted_pred = 0;
     if (x4->weightb >= 0)
         x4->params.analyse.b_weighted_bipred = x4->weightb;
     if (x4->cplxblur >= 0)
@@ -784,6 +788,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
                 OPT_STR(param, val);
             p= strchr(p, ':');
             p+=!!p;
+
+            if (strcmp(param, "bframes") == 0)
+                avctx->max_b_frames = x4->params.i_bframe;
+            if (strcmp(param, "weightp") == 0)
+                x4->weightp = x4->params.analyse.i_weighted_pred;
         }
     }
 
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index d916f11714..b44dd12dff 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -516,6 +516,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
     }
 #endif
 
+    xvid_enc_create.num_slices = avctx->slices;
+
     xvid_enc_create.plugins     = plugins;
     xvid_enc_create.num_plugins = 0;
 
diff --git a/libavutil/time.c b/libavutil/time.c
index afa6658aa6..826ef2e858 100644
--- a/libavutil/time.c
+++ b/libavutil/time.c
@@ -83,15 +83,15 @@ int av_gettime_relative_is_monotonic(void)
 
 int av_usleep(unsigned usec)
 {
-#if HAVE_NANOSLEEP
+#if HAVE_SLEEP
+    Sleep(usec / 1000);
+    return 0;
+#elif HAVE_NANOSLEEP
     struct timespec ts = { usec / 1000000, usec % 1000000 * 1000 };
     while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
     return 0;
 #elif HAVE_USLEEP
     return usleep(usec);
-#elif HAVE_SLEEP
-    Sleep(usec / 1000);
-    return 0;
 #else
     return AVERROR(ENOSYS);
 #endif
