[MPlayer-dev-eng] Re: [PATCH] Fix cut off last few seconds of a file

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 28 12:48:53 CET 2004


Hi,
> > >When the stream has only audio data, the position is incorrectly displayed
> > >(not taking into account audio buffer). This is visible especially on
> > >soundcard drivers with large buffer. The bug is caused by a typo ---
> > >10 * sh_audio->delay is in tenths of seconds, however
> > >audio_out->get_delay() returns seconds, so it doesn't make sense to
> > >subtract them. This patch fixes it (it also fixes wrong display with
> > >different -speed)
> 
> > Sorry for my ignorance, but did this two parches got applied? They work 
> > great for me.
> 
> > >--- ../mplayer-1.0pre4-bak/mplayer.c	2004-05-20 13:22:48.000000000 +0100
> > >+++ mplayer.c	2004-08-01 18:38:21.000000000 +0100
> > >@@ -2013,7 +2013,7 @@
> > >      //
> > >      // convert time to HH:MM:SS.F format
> > >      //
> > >-      long tenths = 10 * sh_audio->delay-audio_out->get_delay();
> > >+      long tenths = 10 * 
> > >(sh_audio->delay-audio_out->get_delay()*playback_speed);
> > >      int hh = (tenths / 36000) % 100;
> > >      int mm = (tenths / 600) % 60;
> > >      int ss = (tenths /  10) % 60;
> 
> This one has been applied already.
> 
> > >--- MPLAYER.C~	2004-08-01 22:24:36.000000000 +0100
> > >+++ mplayer.c	2004-08-02 04:36:24.000000000 +0100
> > >@@ -2044,7 +2044,7 @@
> > >		    ,cache_fill_status
> > >		    );
> > >  }
> > >-  if(d_audio->eof) eof = PT_NEXT_ENTRY;
> > >+  if(d_audio->eof && !audio_out->get_delay()) eof = PT_NEXT_ENTRY;
> > >
> > >} else {
> 
> This part has not.
> Is this okay to apply?

No, this is the wrong way to fix. The audio driver should wait on uninit
until everything was played.
See also http://bugzilla.mplayerhq.hu/show_bug.cgi?id=165 .

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list