summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-01 16:06:41 +0200
committerAnton Kindestam <antonki@kth.se>2018-12-06 10:31:10 +0100
commit9d8afcf79e3a4b563800dcf7fc08779355e9d602 (patch)
tree4e7e6e74d02f2b692194b79569d895d3ccbf7652 /player/loadfile.c
parent02756c3735f8e7e8ac6b5ca1168b68a6a325122d (diff)
downloadmpv-9d8afcf79e3a4b563800dcf7fc08779355e9d602.tar.bz2
mpv-9d8afcf79e3a4b563800dcf7fc08779355e9d602.tar.xz
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.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c7
1 files changed, 5 insertions, 2 deletions
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++;
}
}