From 96a45a16af5594900ca94e7d4abb18d1e6d5ed4a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 7 Feb 2017 17:05:17 +0100 Subject: player: add experimental stream recording feature This is basically a WIP, but it can't remain in a branch forever. A warning is print when using it as it's still a bit "shaky". --- audio/decode/dec_audio.c | 4 ++++ audio/decode/dec_audio.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'audio') diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 56f0fe59ad..5a2735ef20 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -27,6 +27,7 @@ #include "common/codecs.h" #include "common/msg.h" +#include "common/recorder.h" #include "misc/bstr.h" #include "stream/stream.h" @@ -218,6 +219,9 @@ void audio_work(struct dec_audio *da) } if (da->ad_driver->send_packet(da, da->packet)) { + if (da->recorder_sink) + mp_recorder_feed_packet(da->recorder_sink, da->packet); + talloc_free(da->packet); da->packet = NULL; } diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h index ebe7c8ae5b..02447d6742 100644 --- a/audio/decode/dec_audio.h +++ b/audio/decode/dec_audio.h @@ -37,6 +37,8 @@ struct dec_audio { bool try_spdif; + struct mp_recorder_sink *recorder_sink; + // For free use by the ad_driver void *priv; -- cgit v1.2.3