[MPlayer-cvslog] r37656 - trunk/mplayer.c

reimar subversion at mplayerhq.hu
Wed Feb 10 22:19:52 CET 2016


Author: reimar
Date: Wed Feb 10 22:19:52 2016
New Revision: 37656

Log:
mplayer.c: fix reinit_video_chain.

Needs to call video_read_properties otherwise
switching between video streams with different
properties like size will not generally work.

Modified:
   trunk/mplayer.c

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Wed Feb 10 07:52:36 2016	(r37655)
+++ trunk/mplayer.c	Wed Feb 10 22:19:52 2016	(r37656)
@@ -2320,6 +2320,27 @@ int reinit_video_chain(void)
 {
     sh_video_t *const sh_video = mpctx->sh_video;
     double ar = -1.0;
+    if (!video_read_properties(mpctx->sh_video)) {
+        mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CannotReadVideoProperties);
+        goto err_out;
+    } else {
+        mp_msg(MSGT_CPLAYER, MSGL_V, MSGTR_FilefmtFourccSizeFpsFtime,
+               mpctx->demuxer->file_format, mpctx->sh_video->format, mpctx->sh_video->disp_w, mpctx->sh_video->disp_h,
+               mpctx->sh_video->fps, mpctx->sh_video->frametime
+               );
+
+        /* need to set fps here for output encoders to pick it up in their init */
+        if (force_fps) {
+            mpctx->sh_video->fps       = force_fps;
+            mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
+        }
+        vo_fps = mpctx->sh_video->fps;
+
+        if (!mpctx->sh_video->fps && !force_fps && !correct_pts) {
+            mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_FPSnotspecified);
+            correct_pts = 1;
+        }
+    }
     //================== Init VIDEO (codec & libvo) ==========================
     if (!fixed_vo || !(initialized_flags & INITIALIZED_VO)) {
         current_module = "preinit_libvo";
@@ -3537,27 +3558,7 @@ goto_enable_cache:
 
     if (mpctx->sh_video) {
         current_module = "video_read_properties";
-        if (!video_read_properties(mpctx->sh_video)) {
-            mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CannotReadVideoProperties);
-            mpctx->sh_video = mpctx->d_video->sh = NULL;
-        } else {
-            mp_msg(MSGT_CPLAYER, MSGL_V, MSGTR_FilefmtFourccSizeFpsFtime,
-                   mpctx->demuxer->file_format, mpctx->sh_video->format, mpctx->sh_video->disp_w, mpctx->sh_video->disp_h,
-                   mpctx->sh_video->fps, mpctx->sh_video->frametime
-                   );
-
-            /* need to set fps here for output encoders to pick it up in their init */
-            if (force_fps) {
-                mpctx->sh_video->fps       = force_fps;
-                mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
-            }
-            vo_fps = mpctx->sh_video->fps;
-
-            if (!mpctx->sh_video->fps && !force_fps && !correct_pts) {
-                mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_FPSnotspecified);
-                correct_pts = 1;
-            }
-        }
+        reinit_video_chain();
     }
 
     if (!mpctx->sh_video && !mpctx->sh_audio) {
@@ -3623,9 +3624,6 @@ goto_enable_cache:
         }
     }
 
-    if (mpctx->sh_video)
-        reinit_video_chain();
-
     if (mpctx->sh_video) {
         if (vo_flags & 0x08 && vo_spudec)
             spudec_set_hw_spu(vo_spudec, mpctx->video_out);


More information about the MPlayer-cvslog mailing list