mxfdemux: Don't double-increase track position

The essence track position should only be overriden if we sucesfully switched to
another position. In case of EOS we do not want to override it else we would
increase the track position *again* at the end of this function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2162>
This commit is contained in:
Edward Hervey 2022-04-11 10:31:15 +02:00 committed by Tim-Philipp Müller
parent cd577c78f7
commit 98afe3bacd

View file

@ -3109,11 +3109,11 @@ gst_mxf_demux_handle_generic_container_essence_element (GstMXFDemux * demux,
ret =
gst_mxf_demux_pad_set_component (demux, pad,
pad->current_component_index + 1);
if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS) {
GST_ERROR_OBJECT (demux, "Switching component failed");
} else {
if (ret == GST_FLOW_OK) {
pad->current_essence_track->position =
pad->current_essence_track_position;
} else if (ret != GST_FLOW_EOS) {
GST_ERROR_OBJECT (demux, "Switching component failed");
}
} else if (etrack->duration > 0
&& pad->current_essence_track_position >= etrack->duration) {