summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-10 22:01:23 +0100
committerwm4 <wm4@nowhere>2014-11-10 22:02:05 +0100
commit5fd8a1e04c725329435e3bead5f11ee3ffb9f1c1 (patch)
treea3a3ae0ac6ee87449ed780604e55da6dca2f34f2 /player/command.c
parent46d6fb9dc1a820b58dd3ffcc155195aea6bb0bd1 (diff)
downloadmpv-5fd8a1e04c725329435e3bead5f11ee3ffb9f1c1.tar.bz2
mpv-5fd8a1e04c725329435e3bead5f11ee3ffb9f1c1.tar.xz
audio: make decoders output refcounted frames
This rewrites the audio decode loop to some degree. Audio filters don't do refcounted frames yet, so af.c contains a hacky "emulation". Remove some of the weird heuristic-heavy code in dec_audio.c. Instead of estimating how much audio we need to filter, we always filter full frames. Maybe this should be adjusted later: in case filtering increases the volume of the audio data, we should try not to buffer too much filter output by reducing the input that is fed at once. For ad_spdif.c and ad_mpg123.c, we don't avoid extra copying yet - it doesn't seem worth the trouble.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 04c0c4d789..3513d99afc 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1550,7 +1550,7 @@ static int mp_property_samplerate(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
struct mp_audio fmt = {0};
if (mpctx->d_audio)
- mp_audio_buffer_get_format(mpctx->d_audio->decode_buffer, &fmt);
+ fmt = mpctx->d_audio->decode_format;
if (!fmt.rate)
return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_PRINT) {
@@ -1567,7 +1567,7 @@ static int mp_property_channels(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
struct mp_audio fmt = {0};
if (mpctx->d_audio)
- mp_audio_buffer_get_format(mpctx->d_audio->decode_buffer, &fmt);
+ fmt = mpctx->d_audio->decode_format;
if (!fmt.channels.num)
return M_PROPERTY_UNAVAILABLE;
switch (action) {