From: Jimmy Ohn Date: Wed, 29 Apr 2015 09:23:31 +0000 (+0900) Subject: adaptivedemux: only update stream position if query success X-Git-Tag: 1.19.3~507^2~8813 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=868472affb183f457e3ad584bd8d9dabd8ee5938;p=platform%2Fupstream%2Fgstreamer.git adaptivedemux: only update stream position if query success We don't need to check about the query fail case. because it is update to segment position even though query fail. https://bugzilla.gnome.org/show_bug.cgi?id=748529 --- diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index cac3ff6..655e03e 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1974,38 +1974,27 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream) GST_DEBUG_OBJECT (stream->pad, "Activating stream due to reconfigure event"); - cur = stream->segment.position; + cur = ts = stream->segment.position; if (gst_pad_peer_query_position (stream->pad, GST_FORMAT_TIME, &pos)) { ts = (GstClockTime) pos; GST_DEBUG_OBJECT (demux, "Downstream position: %" GST_TIME_FORMAT, GST_TIME_ARGS (ts)); } else { - gboolean have_pos = FALSE; - /* query other pads as some faulty element in the pad's branch might * reject position queries. This should be better than using the * demux segment position that can be much ahead */ for (GList * iter = demux->streams; iter != NULL; iter = g_list_next (iter)) { - GstAdaptiveDemuxStream *cur_stream = iter->data; + GstAdaptiveDemuxStream *cur_stream = (GstAdaptiveDemuxStream *)iter->data; - have_pos = - gst_pad_peer_query_position (cur_stream->pad, GST_FORMAT_TIME, - &pos); - if (have_pos) { + if (gst_pad_peer_query_position (cur_stream->pad, GST_FORMAT_TIME, &pos)) { ts = (GstClockTime) pos; GST_DEBUG_OBJECT (stream->pad, "Downstream position: %" GST_TIME_FORMAT, GST_TIME_ARGS (ts)); break; } } - - if (!have_pos) { - ts = stream->segment.position; - GST_DEBUG_OBJECT (stream->pad, "Downstream position query failed, " - "failling back to looking at other pads"); - } } /* we might have already pushed this data */