summaryrefslogtreecommitdiffstats
path: root/audio/decode/dec_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 /audio/decode/dec_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 'audio/decode/dec_audio.c')
-rw-r--r--audio/decode/dec_audio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c
index b8d83e899c..b8e14dfbf3 100644
--- a/audio/decode/dec_audio.c
+++ b/audio/decode/dec_audio.c
@@ -260,7 +260,7 @@ static int filter_n_bytes(struct dec_audio *da, struct mp_audio_buffer *outbuf,
// first, and don't signal a format change to the caller yet.
if (mp_audio_buffer_samples(da->decode_buffer) > 0)
break;
- error = -2;
+ error = AD_NEW_FMT;
break;
}
}
@@ -274,7 +274,7 @@ static int filter_n_bytes(struct dec_audio *da, struct mp_audio_buffer *outbuf,
bool eof = filter_data.samples == 0 && error < 0;
if (af_filter(da->afilter, &filter_data, eof ? AF_FILTER_FLAG_EOF : 0) < 0)
- return -1;
+ return AD_ERR;
mp_audio_buffer_append(outbuf, &filter_data);
if (eof && filter_data.samples > 0)
@@ -285,9 +285,9 @@ static int filter_n_bytes(struct dec_audio *da, struct mp_audio_buffer *outbuf,
// Assume the filter chain is drained from old data at this point.
// (If not, the remaining old data is discarded.)
- if (error == -2) {
+ if (error == AD_NEW_FMT) {
if (!reinit_audio_buffer(da))
- error = -1; // switch to invalid format
+ error = AD_ERR; // switch to invalid format
}
return error;
@@ -295,7 +295,7 @@ static int filter_n_bytes(struct dec_audio *da, struct mp_audio_buffer *outbuf,
/* Try to get at least minsamples decoded+filtered samples in outbuf
* (total length including possible existing data).
- * Return 0 on success, -1 on error/EOF (not distinguidaed).
+ * Return 0 on success, or negative AD_* error code.
* In the former case outbuf has at least minsamples buffered on return.
* In case of EOF/error it might or might not be. */
int audio_decode(struct dec_audio *d_audio, struct mp_audio_buffer *outbuf,