1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-12 09:56:30 +00:00

audio: handle reinit after AO reload slightly cleaner

Don't print bogus messages about packets read in verbose mode.
This commit is contained in:
wm4 2014-11-09 09:54:39 +01:00
parent 4235aab897
commit 7ee4e53369

View File

@ -443,14 +443,14 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
int r = initial_audio_decode(mpctx->d_audio); int r = initial_audio_decode(mpctx->d_audio);
if (r == AD_WAIT) if (r == AD_WAIT)
return; // continue later when new data is available return; // continue later when new data is available
mpctx->d_audio->init_retries += 1; if (r != AD_OK) {
MP_VERBOSE(mpctx, "Initial audio packets read: %d\n", mpctx->d_audio->init_retries += 1;
mpctx->d_audio->init_retries); if (mpctx->d_audio->init_retries >= 50) {
if (r != AD_OK && mpctx->d_audio->init_retries >= 50) { MP_ERR(mpctx, "Error initializing audio.\n");
MP_ERR(mpctx, "Error initializing audio.\n"); struct track *track = mpctx->current_track[0][STREAM_AUDIO];
struct track *track = mpctx->current_track[0][STREAM_AUDIO]; mp_deselect_track(mpctx, track);
mp_deselect_track(mpctx, track); return;
return; }
} }
reinit_audio_chain(mpctx); reinit_audio_chain(mpctx);
mpctx->sleeptime = 0; mpctx->sleeptime = 0;