From 1088f695a26563a589db736dccc403f0cb284354 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Fri, 30 Mar 2007 23:58:12 +0000 Subject: Another AV sync bugfix - the initial avdelay was being incorrectly calculated in some cases git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12975 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/mpegplayer/mpegplayer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index a7157538ea..f2196d548f 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -631,7 +631,9 @@ static void audio_thread(void) if (!found_avdelay) { if ((audio_str.first_pts != 0) && (video_str.first_pts != 0)) { - avdelay = ((audio_str.first_pts - video_str.first_pts)*44100)/90000; + avdelay = audio_str.first_pts - video_str.first_pts; + avdelay *= 44100; + avdelay /= 90000; found_avdelay = 1; DEBUGF("First Audio PTS = %u, First Video PTS=%u, A-V=%d samples\n",(unsigned int)audio_str.first_pts,(unsigned int)video_str.first_pts,avdelay); } -- cgit v1.2.3