From d486fb2ca1e27fa66a52dcf60506cba6d9d464d2 Mon Sep 17 00:00:00 2001 From: Johns Date: Sat, 30 Jun 2012 00:19:36 +0200 Subject: Fix bug: audio use 100% CPU during pause. --- audio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'audio.c') diff --git a/audio.c b/audio.c index f7fcc41..cfab1bf 100644 --- a/audio.c +++ b/audio.c @@ -3474,6 +3474,10 @@ static void *AudioPlayHandlerThread(void *dummy) AudioResetNormalizer(); } } + // FIXME: check AudioPaused ...Thread() + if (AudioPaused) { + break; + } } while (AudioRing[AudioRingRead].HwSampleRate); } return dummy; @@ -3755,7 +3759,7 @@ void AudioVideoReady(int64_t pts) VideoAudioDelay / 90, skip / 90); #endif // guard against old PTS - if (skip> 0 && skip < 2000 * 90) { + if (skip > 0 && skip < 2000 * 90) { skip = (((int64_t) skip * AudioRing[AudioRingWrite].HwSampleRate) / (1000 * 90)) * AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample; -- cgit v1.2.3