recorder: clear packet queue after they've been muxed

In commit f7678575a5, 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!
This commit is contained in:
TheAMM 2021-05-29 00:43:19 +03:00 committed by Jan Ekström
parent b3fccf0803
commit 27db175ab6
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}