summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTheAMM <the.actual.amm@gmail.com>2021-05-29 00:43:19 +0300
committerJan Ekström <jeebjp@gmail.com>2021-07-08 12:44:06 +0300
commit27db175ab6ba4f821d92fff3c2d6186b91fe567a (patch)
tree68af967025527bac248f864afc9a6bcea470d6eb /common
parentb3fccf080369730e1b4d6a3435c90124a74566f7 (diff)
downloadmpv-27db175ab6ba4f821d92fff3c2d6186b91fe567a.tar.bz2
mpv-27db175ab6ba4f821d92fff3c2d6186b91fe567a.tar.xz
recorder: clear packet queue after they've been muxed
In commit f7678575a5d7f598abf267cb303e0a74db276f27, wm4 chooses to mux all remaining packets when mp_recorder_mark_discontinuity() is called and adds a call to mux_packets(). However, it is called only after flush_packets(), which clears the packets before they can be muxed out. This has no ill effects per se - recordings end on keyframes, as before - but judging from his commit message, the intention explicitly was to output the inter frames, since long GOPs can mean several seconds of missing content from the output. So, clear the stream packet queues only after the final mux. Also, flushing can mean both discarding and committing. What a country!
Diffstat (limited to 'common')
-rw-r--r--common/recorder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/recorder.c b/common/recorder.c
index aad9faf40c..215a1ccb16 100644
--- a/common/recorder.c
+++ b/common/recorder.c
@@ -318,7 +318,6 @@ void mp_recorder_destroy(struct mp_recorder *priv)
// This is called on a seek, or when recording was started mid-stream.
void mp_recorder_mark_discontinuity(struct mp_recorder *priv)
{
- flush_packets(priv);
for (int n = 0; n < priv->num_streams; n++) {
struct mp_recorder_sink *rst = priv->streams[n];
@@ -327,6 +326,7 @@ void mp_recorder_mark_discontinuity(struct mp_recorder *priv)
rst->proper_eof = false;
}
+ flush_packets(priv);
priv->muxing = false;
priv->muxing_from_start = false;
}