[MPlayer-dev-eng] [PATCH] Correct displaying of position in audio-only streams

Mikulas Patocka mikulas at artax.karlin.mff.cuni.cz
Mon Aug 2 17:08:41 CEST 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)

Mikulas
-------------- next part --------------
--- ../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;


More information about the MPlayer-dev-eng mailing list