matroskademux: Don't compare running times with stream times when doing QoS

This commit is contained in:
Sebastian Dröge 2010-05-31 07:49:21 +02:00
parent d09ff4124e
commit 0d5ae784b1

View file

@ -4669,22 +4669,25 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
stream->index_table) { stream->index_table) {
GstMatroskaTrackVideoContext *videocontext = GstMatroskaTrackVideoContext *videocontext =
(GstMatroskaTrackVideoContext *) stream; (GstMatroskaTrackVideoContext *) stream;
GstClockTime running_time;
GstClockTime earliest_time; GstClockTime earliest_time;
running_time = gst_segment_to_running_time (&demux->segment, GstClockTime earliest_stream_time;
GST_FORMAT_TIME, lace_time);
GST_OBJECT_LOCK (demux); GST_OBJECT_LOCK (demux);
earliest_time = videocontext->earliest_time; earliest_time = videocontext->earliest_time;
GST_OBJECT_UNLOCK (demux); GST_OBJECT_UNLOCK (demux);
if (GST_CLOCK_TIME_IS_VALID (running_time) && earliest_stream_time = gst_segment_to_position (&demux->segment,
GST_CLOCK_TIME_IS_VALID (earliest_time) && GST_FORMAT_TIME, earliest_time);
running_time <= earliest_time) {
/* find index entry (keyframe) <= earliest_time */ if (GST_CLOCK_TIME_IS_VALID (lace_time) &&
GST_CLOCK_TIME_IS_VALID (earliest_stream_time) &&
lace_time <= earliest_stream_time) {
/* find index entry (keyframe) <= earliest_stream_time */
GstMatroskaIndex *entry = GstMatroskaIndex *entry =
gst_util_array_binary_search (stream->index_table->data, gst_util_array_binary_search (stream->index_table->data,
stream->index_table->len, sizeof (GstMatroskaIndex), stream->index_table->len, sizeof (GstMatroskaIndex),
(GCompareDataFunc) gst_matroska_index_seek_find, (GCompareDataFunc) gst_matroska_index_seek_find,
GST_SEARCH_MODE_BEFORE, &earliest_time, NULL); GST_SEARCH_MODE_BEFORE, &earliest_stream_time, NULL);
/* if that entry (keyframe) is after the current the current /* if that entry (keyframe) is after the current the current
buffer, we can skip pushing (and thus decoding) all buffer, we can skip pushing (and thus decoding) all
buffers until that keyframe. */ buffers until that keyframe. */