[MPlayer-dev-eng] [PATCH] demux_lavf should consider start_time when calculation percentage bar
Nico Sabbi
nicola_sabbi at fastwebnet.it
Sun Jul 16 18:37:09 CEST 2006
Reimar Döffinger wrote:
>Hello,
>currently with some files (e.g.
>http://ktown.kde.org/akademy/Scott_And_Christian_GStreamer_video.ogg)
>the position bar never drops below half-full with -demuxer lavf since
>the stream starts with a timestamp of 1 hour.
>The attached patch fixes this for the cases where libavformat sets
>start_time correctly (for above file in combination with the patch I
>recently sent to ffmpeg).
>Ok to apply?
>
>Greetings,
>Reimar Döffinger
>
>
>------------------------------------------------------------------------
>
>Index: libmpdemux/demux_lavf.c
>===================================================================
>--- libmpdemux/demux_lavf.c (revision 19124)
>+++ libmpdemux/demux_lavf.c (working copy)
>@@ -404,7 +404,7 @@
> if (priv->avfc->duration == 0)
> return DEMUXER_CTRL_DONTKNOW;
>
>- *((int *)arg) = (int)(priv->last_pts*100 / priv->avfc->duration);
>+ *((int *)arg) = (int)((priv->last_pts - priv->avfc->start_time)*100 / priv->avfc->duration);
> return DEMUXER_CTRL_OK;
> case DEMUXER_CTRL_SWITCH_AUDIO:
> {
>
>
>------------------------------------------------------------------------
>
>
>
what will happen with streams with resetting timers? (mpeg* et al)
More information about the MPlayer-dev-eng
mailing list