From 9736f3309acf387e42aef847f594463e3351bbc2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 20 Jul 2014 20:42:03 +0200 Subject: audio: use symbolic constants instead of magic integers Similar to commit 26468743. --- player/audio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'player/audio.c') diff --git a/player/audio.c b/player/audio.c index d0f78b3643..d893206764 100644 --- a/player/audio.c +++ b/player/audio.c @@ -297,7 +297,6 @@ static int write_silence_to_ao(struct MPContext *mpctx, int samples, int flags, return r; } -#define ASYNC_PLAY_DONE -3 static int audio_start_sync(struct MPContext *mpctx, int playsize) { struct ao *ao = mpctx->ao; @@ -374,7 +373,7 @@ static int audio_start_sync(struct MPContext *mpctx, int playsize) * in playsize. */ write_silence_to_ao(mpctx, playsize, 0, written_pts - samples / real_samplerate); - return ASYNC_PLAY_DONE; + return AD_ASYNC_PLAY_DONE; } mpctx->syncing_audio = false; mp_audio_buffer_prepend_silence(mpctx->ao_buffer, samples); @@ -418,7 +417,7 @@ int fill_audio_out_buffers(struct MPContext *mpctx, double endpts) res = audio_decode(d_audio, mpctx->ao_buffer, playsize); if (res < 0) { // EOF, error or format change - if (res == -2) { + if (res == AD_NEW_FMT) { /* The format change isn't handled too gracefully. A more precise * implementation would require draining buffered old-format audio * while displaying video, then doing the output format switch. @@ -427,7 +426,7 @@ int fill_audio_out_buffers(struct MPContext *mpctx, double endpts) uninit_player(mpctx, INITIALIZED_AO); reinit_audio_chain(mpctx); return -1; - } else if (res == ASYNC_PLAY_DONE) + } else if (res == AD_ASYNC_PLAY_DONE) return 0; else if (demux_stream_eof(d_audio->header)) audio_eof = true; -- cgit v1.2.3