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.
This commit is contained in:
wm4
2018-09-01 16:06:41 +02:00
committed by Anton Kindestam
parent 02756c3735
commit 9d8afcf79e
5 changed files with 53 additions and 4 deletions

View File

@@ -335,8 +335,7 @@ void mp_recorder_mark_discontinuity(struct mp_recorder *priv)
// mp_recorder_create().
struct mp_recorder_sink *mp_recorder_get_sink(struct mp_recorder *r, int stream)
{
assert(stream >= 0 && stream < r->num_streams);
return r->streams[stream];
return stream >= 0 && stream < r->num_streams ? r->streams[stream] : NULL;
}
// Pass a packet to the given stream. The function does not own the packet, but