[MPlayer-dev-eng] [PATCH] demux_lavf should consider start_time when calculation percentage bar
Michael Niedermayer
michaelni at gmx.at
Sun Jul 16 19:21:27 CEST 2006
Hi
On Sun, Jul 16, 2006 at 06:37:09PM +0200, Nico Sabbi wrote:
> 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)
results will be as random as they are already
maybe we should add a check for mpeg-ps/ts and seek per byte instead of per
time for them ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the MPlayer-dev-eng
mailing list