From 7ee4e533693ee02e660ae0efb2e0e94db8c8c5af Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 9 Nov 2014 09:54:39 +0100 Subject: [PATCH] audio: handle reinit after AO reload slightly cleaner Don't print bogus messages about packets read in verbose mode. --- player/audio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/player/audio.c b/player/audio.c index 75989bfe20..8df6053da1 100644 --- a/player/audio.c +++ b/player/audio.c @@ -443,14 +443,14 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts) int r = initial_audio_decode(mpctx->d_audio); if (r == AD_WAIT) return; // continue later when new data is available - mpctx->d_audio->init_retries += 1; - MP_VERBOSE(mpctx, "Initial audio packets read: %d\n", - mpctx->d_audio->init_retries); - if (r != AD_OK && mpctx->d_audio->init_retries >= 50) { - MP_ERR(mpctx, "Error initializing audio.\n"); - struct track *track = mpctx->current_track[0][STREAM_AUDIO]; - mp_deselect_track(mpctx, track); - return; + if (r != AD_OK) { + mpctx->d_audio->init_retries += 1; + if (mpctx->d_audio->init_retries >= 50) { + MP_ERR(mpctx, "Error initializing audio.\n"); + struct track *track = mpctx->current_track[0][STREAM_AUDIO]; + mp_deselect_track(mpctx, track); + return; + } } reinit_audio_chain(mpctx); mpctx->sleeptime = 0;