[MPlayer-dev-eng] [PATCH] demux_lavf should consider start_time when calculation percentage bar

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Jul 16 18:24:19 CEST 2006


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
-------------- next part --------------
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:
 	{


More information about the MPlayer-dev-eng mailing list