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

Alexander Strasser eclipse7 at gmx.net
Sun Feb 14 21:20:38 CET 2016


Hi Reimar!

On 2016-02-10 22:19 +0100, reimar wrote:
> 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 {

  I guess you put the following code into the else-block because of the
origin of this hunk (can also be seen further below). Otherwise I guess
it could have been ommitted an put up one level of indentation in the
presence of the goto you added inside the if-then-block.

  But maybe I am missing something! Anyway no need for changing...

Thanks for improving the code,
  Alexander


> +        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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20160214/e5d4b9a7/attachment-0001.sig>


More information about the MPlayer-cvslog mailing list