From e52740570a3e6a26645babf5b3c576fe96d6bd09 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 26 Apr 2007 20:17:20 +0000 Subject: [PATCH] More correct playback position reporting. Originally committed to SVN as r1147. --- aegisub/audio_player_alsa.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/audio_player_alsa.cpp b/aegisub/audio_player_alsa.cpp index b349ba880..7dbafe0d4 100644 --- a/aegisub/audio_player_alsa.cpp +++ b/aegisub/audio_player_alsa.cpp @@ -397,7 +397,9 @@ __int64 AlsaPlayer::GetEndPosition() // Get current position __int64 AlsaPlayer::GetCurrentPosition() { - return cur_frame - bufsize; // FIXME + snd_pcm_sframes_t delay = 0; + snd_pcm_delay(pcm_handle, &delay); // don't bother catching errors here + return cur_frame - delay; }