summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-20 20:42:03 +0200
committerwm4 <wm4@nowhere>2014-07-20 20:42:03 +0200
commit9736f3309acf387e42aef847f594463e3351bbc2 (patch)
treeff3feecdb9dbbec909ed18c681e8a3047277a6d6 /player/audio.c
parente982b5b287d1a178bea444c6d0f81a877db2d0c9 (diff)
downloadmpv-9736f3309acf387e42aef847f594463e3351bbc2.tar.bz2
mpv-9736f3309acf387e42aef847f594463e3351bbc2.tar.xz
audio: use symbolic constants instead of magic integers
Similar to commit 26468743.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c7
1 files changed, 3 insertions, 4 deletions
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;