Skip to content

oggdemux: Do not overwrite valid duration with GST_CLOCK_TIME_NONE, fixes seeking in some cases

Tomas Granath requested to merge granath/gstreamer:fix-4110 into main

After calculating a correct duration the oggdemux in some cases sets the duration to GST_CLOCK_TIME_NONE. After that any seek will fail due to the oggdemux calculating a target time after the actual duration. This MR fixes that problem.

Solves #4110


Describe your issue

After calculating a correct duration the oggdemux in some cases sets the duration to GST_CLOCK_TIME_NONE. After that any seek will fail due to the oggdemux calculating a target time after the actual duration.

The reason for this is the check made here: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blame/main/subprojects/gst-plugins-base/ext/ogg/gstoggdemux.c?ref_type=heads#L664

If the ipad->map.total_time is GST_CLOCK_TIME_NONE the duration is set to GST_CLOCK_TIME_NONE. Changing the linked line from } else if (ipad->map.total_time > 0) { to } else if (ipad->map.total_time != GST_CLOCK_TIME_NONE) { solves the problem.

Expected Behavior

Seeking to the target time.

Observed Behavior

The seek is made to a point in time after the duration with EOS as result.

Setup

  • **GStreamer Version:1.24.10, also checked that this problem still remains on git main

(added issue description from #4110, tpm)

Edited by Tim-Philipp Müller

Merge request reports

Loading