From 9d8afcf79e3a4b563800dcf7fc08779355e9d602 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Sep 2018 16:06:41 +0200 Subject: demux: add another stream recording feature --record-file is nice, but only sometimes. If you watch some sort of livestream which you want to record, it's actually much nicer not to record what you're currently "seeing", but anything you're receiving. --- player/loadfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 9d37c2ca21..4dff4c710c 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -974,6 +974,7 @@ static void *open_demux_thread(void *ctx) struct demuxer_params p = { .force_format = mpctx->open_format, .stream_flags = mpctx->open_url_flags, + .stream_record = true, }; mpctx->open_res_demuxer = demux_open_url(mpctx->open_url, &p, mpctx->open_cancel, mpctx->global); @@ -1848,8 +1849,10 @@ void open_recorder(struct MPContext *mpctx, bool on_init) break; // (We expect track->stream not to be reused on other tracks.) if (track->stream == streams[n_stream]) { - set_track_recorder_sink(track, - mp_recorder_get_sink(mpctx->recorder, n_stream)); + struct mp_recorder_sink * sink = + mp_recorder_get_sink(mpctx->recorder, n_stream); + assert(sink); + set_track_recorder_sink(track, sink); n_stream++; } } -- cgit v1.2.3