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

Julián Nuñez julian at proteger.org.ar
Mon Aug 23 17:00:49 CEST 2004


Mikulas Patocka <mikulas at artax.karlin.mff.cuni.cz> wrote:

>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)
>
>Mikulas
>
>------------------------------------------------------------------------
>
>--- ../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;
>  
>
>
> ------------------------------------------------------------------------
>
> Subject:
> [MPlayer-dev-eng] [PATCH] Fix cut off last few seconds of a file
> From:
> Mikulas Patocka <mikulas at artax.karlin.mff.cuni.cz>
> Date:
> Mon, 2 Aug 2004 17:16:17 +0200 (CEST)
> To:
> mplayer-dev-eng at mplayerhq.hu
>
>
>Hi
>
>When audio buffer is X seconds large and mplayer is playing audio-only
>stream, it doesn't play last X seconds (it ends at the point when all the
>stream is decoded, not at the point when sound card buffer is finished).
>This patch fixes it.
>
>Mikulas
>
>------------------------------------------------------------------------
>
>--- 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 {
> 
>  
>
Sorry for my ignorance, but did this two parches got applied? They work 
great for me.

-- 
"El verdadero valor esta en hacer sin testigos, lo que podría hacerse delante de todo el mundo"






More information about the MPlayer-dev-eng mailing list