mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 15:22:09 +00:00
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:
parent
b3fccf0803
commit
27db175ab6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user