mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
qtmux: Select the best pad based on the cached last_buf if any
last_buf is the one we're going to write next, not buf. As such we should check timestamps against that one if there is one to select the earliest pad. Also remember the currently selected pad in the very beginning when storing the first last_buf. This both solves some edge cases where not the correct next pad was selected corresponding to the target interleave.
This commit is contained in:
parent
eb307baff4
commit
6b889bea69
1 changed files with 5 additions and 1 deletions
|
@ -3234,6 +3234,7 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
|
|||
}
|
||||
#endif
|
||||
pad->last_buf = buf;
|
||||
qtmux->current_pad = pad;
|
||||
goto exit;
|
||||
} else {
|
||||
gst_buffer_ref (last_buf);
|
||||
|
@ -3600,7 +3601,10 @@ find_best_pad (GstQTMux * qtmux, GstCollectPads * pads)
|
|||
continue;
|
||||
}
|
||||
} else {
|
||||
timestamp = GST_BUFFER_DTS_OR_PTS (tmp_buf);
|
||||
if (qtpad->last_buf)
|
||||
timestamp = GST_BUFFER_DTS_OR_PTS (qtpad->last_buf);
|
||||
else
|
||||
timestamp = GST_BUFFER_DTS_OR_PTS (tmp_buf);
|
||||
}
|
||||
|
||||
if (best_pad == NULL ||
|
||||
|
|
Loading…
Reference in a new issue