[MPlayer-cvslog] r36401 - trunk/libmpcodecs/vd.c

ib subversion at mplayerhq.hu
Sun Aug 4 22:19:58 CEST 2013


Author: ib
Date: Sun Aug  4 22:19:58 2013
New Revision: 36401

Log:
Enable switch_ratio -1 with videos with aspect changes.

The original aspect ratio may change during playback,
so sh->original_aspect must be set accordingly.

This is missing in r36391.

Modified:
   trunk/libmpcodecs/vd.c

Modified: trunk/libmpcodecs/vd.c
==============================================================================
--- trunk/libmpcodecs/vd.c	Sun Aug  4 20:12:24 2013	(r36400)
+++ trunk/libmpcodecs/vd.c	Sun Aug  4 22:19:58 2013	(r36401)
@@ -158,6 +158,7 @@ int mpcodecs_config_vo(sh_video_t *sh, i
     vf_instance_t *vf = sh->vfilter, *sc = NULL;
     int palette = 0;
     int vocfg_flags = 0;
+    static float last_movie_aspect;
 
     if (w)
         sh->disp_w = w;
@@ -290,17 +291,26 @@ int mpcodecs_config_vo(sh_video_t *sh, i
         vf_add_before_vo(&vf, "flip", NULL);
         sh->vfilter = vf;
     }
-    // time to do aspect ratio corrections...
+    // time to do aspect ratio corrections (after saving the original aspect ratio)...
 
-    if (sh->original_aspect == -1.0)
+    if (sh->original_aspect == -1.0) {
         sh->original_aspect = sh->stream_aspect != 0.0 ? sh->stream_aspect : sh->aspect;
+        last_movie_aspect = -1.0;
+    }
 
-    if (movie_aspect > -1.0)
+    if (movie_aspect > -1.0) {
+        if (sh->aspect != movie_aspect && movie_aspect == last_movie_aspect)
+            sh->original_aspect = sh->stream_aspect != 0.0 ? sh->stream_aspect : sh->aspect;
         sh->aspect = movie_aspect;      // cmdline overrides autodetect
+    }
     else if (sh->stream_aspect != 0.0)
-        sh->aspect = sh->stream_aspect;
+        sh->original_aspect = sh->aspect = sh->stream_aspect;
+    else
+        sh->original_aspect = sh->aspect;
 //  if(!sh->aspect) sh->aspect=1.0;
 
+    last_movie_aspect = movie_aspect;
+
     if (opt_screen_size_x || opt_screen_size_y) {
         screen_size_x = opt_screen_size_x;
         screen_size_y = opt_screen_size_y;


More information about the MPlayer-cvslog mailing list