diff options
author | wm4 <wm4@nowhere> | 2014-07-21 19:29:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-21 19:29:58 +0200 |
commit | b6af44d31e5c00b512e4c64b7075b771286e7c74 (patch) | |
tree | 0590b1095d13c61a538d622c1383f96554f27c85 /audio/decode/dec_audio.h | |
parent | 1f9e0a15a13f9b1efece10515c57e5ed4683e9f3 (diff) | |
download | mpv-b6af44d31e5c00b512e4c64b7075b771286e7c74.tar.bz2 mpv-b6af44d31e5c00b512e4c64b7075b771286e7c74.tar.xz |
audio: move initial decode to generic code
This commit mainly moves the initial decoding of data (done to probe the
audio format) to generic code. This will make it easier to make audio
decoding non-blocking in a later commit.
This commit also changes how decoders return data: instead of having
them write the data into a prepared buffer, they return a reference to
an internal buffer (by setting dec_audio.decoded). This makes it
significantly easier to handle audio format changes, since the decoders
don't really need to care anymore.
Diffstat (limited to 'audio/decode/dec_audio.h')
-rw-r--r-- | audio/decode/dec_audio.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h index 25afda1390..c1b5eafb49 100644 --- a/audio/decode/dec_audio.h +++ b/audio/decode/dec_audio.h @@ -38,9 +38,7 @@ struct dec_audio { char *decoder_desc; struct replaygain_data *replaygain_data; // set by decoder - struct mp_audio decoded; // format of decoded audio (no data, temporarily - // different from decode_buffer during format - // changes) + struct mp_audio decoded; // decoded audio set by last decode_packet() call int bitrate; // input bitrate, can change with VBR sources // last known pts value in output from decoder double pts; @@ -53,6 +51,7 @@ struct dec_audio { enum { AD_OK = 0, AD_ERR = -1, + AD_EOF = -1, // same as AD_ERR for now AD_NEW_FMT = -2, AD_ASYNC_PLAY_DONE = -3, }; |