summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-29 06:18:33 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-30 03:10:27 -0800
commit76e7e78ce989aad546310b9808cf7f96f23a281f (patch)
treee4432df6f925d2a1f9e5022373d359b626d9ea09 /player/playloop.c
parent054c02ad64a62dd8393bde0fd73edeaa71048722 (diff)
downloadmpv-76e7e78ce989aad546310b9808cf7f96f23a281f.tar.bz2
mpv-76e7e78ce989aad546310b9808cf7f96f23a281f.tar.xz
audio: move to decoder wrapper
Use the decoder wrapper that was introduced for video. This removes all code duplication the old audio decoder wrapper had with the video code. (The audio wrapper was copy pasted from the video one over a decade ago, and has been kept in sync ever since by the power of copy&paste. Since the original copy&paste was possibly done by someone who did not answer to the LGPL relicensing, this should also remove all doubts about whether any of this code is left, since we now completely remove any code that could possibly have been based on it.) There is some complication with spdif handling, and a minor behavior change (it will restrict the list of codecs to spdif if spdif is to be used), but there should not be any difference in practice.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 748469354d..e77200f2d7 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -39,7 +39,6 @@
#include "osdep/terminal.h"
#include "osdep/timer.h"
-#include "audio/decode/dec_audio.h"
#include "audio/out/ao.h"
#include "demux/demux.h"
#include "stream/stream.h"
@@ -212,12 +211,6 @@ void add_step_frame(struct MPContext *mpctx, int dir)
// Clear some playback-related fields on file loading or after seeks.
void reset_playback_state(struct MPContext *mpctx)
{
- for (int n = 0; n < mpctx->num_tracks; n++) {
- if (mpctx->tracks[n]->d_audio)
- audio_reset_decoding(mpctx->tracks[n]->d_audio);
- mpctx->tracks[n]->sink_eof = false;
- }
-
mp_filter_reset(mpctx->filter_root);
reset_video_state(mpctx);
@@ -1076,35 +1069,6 @@ static void handle_eof(struct MPContext *mpctx)
}
}
-static void handle_complex_filter_decoders(struct MPContext *mpctx)
-{
- if (!mpctx->lavfi)
- return;
-
- for (int n = 0; n < mpctx->num_tracks; n++) {
- struct track *track = mpctx->tracks[n];
- if (!track->selected)
- continue;
- if (track->d_audio) {
- if (!track->sink || !mp_pin_in_needs_data(track->sink))
- continue;
- audio_work(track->d_audio);
- struct mp_aframe *fr;
- int res = audio_get_frame(track->d_audio, &fr);
- if (res == DATA_OK) {
- mp_pin_in_write(track->sink, MAKE_FRAME(MP_FRAME_AUDIO, fr));
- track->sink_eof = false;
- } else if (res == DATA_EOF) {
- if (!track->sink_eof)
- mp_pin_in_write(track->sink, MP_EOF_FRAME);
- track->sink_eof = true;
- } else if (res == DATA_AGAIN) {
- mp_wakeup_core(mpctx);
- }
- }
- }
-}
-
void run_playloop(struct MPContext *mpctx)
{
#if HAVE_ENCODING
@@ -1116,8 +1080,6 @@ void run_playloop(struct MPContext *mpctx)
update_demuxer_properties(mpctx);
- handle_complex_filter_decoders(mpctx);
-
handle_cursor_autohide(mpctx);
handle_vo_events(mpctx);
handle_command_updates(mpctx);