mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-12 09:15:29 +00:00
adaptivedemux: remove more get_duration checks
Subclasses must implement get_duration function. If they do not know the duration they can return GST_CLOCK_TIME_NONE
This commit is contained in:
parent
9afed503ed
commit
d9944506c8
1 changed files with 12 additions and 16 deletions
|
@ -952,8 +952,7 @@ gst_adaptive_demux_src_query (GstPad * pad, GstObject * parent,
|
||||||
|
|
||||||
GST_MANIFEST_LOCK (demux);
|
GST_MANIFEST_LOCK (demux);
|
||||||
gst_query_parse_duration (query, &fmt, NULL);
|
gst_query_parse_duration (query, &fmt, NULL);
|
||||||
if (fmt == GST_FORMAT_TIME && demux->priv->manifest_buffer != NULL
|
if (fmt == GST_FORMAT_TIME && demux->priv->manifest_buffer != NULL) {
|
||||||
&& demux_class->get_duration) {
|
|
||||||
duration = demux_class->get_duration (demux);
|
duration = demux_class->get_duration (demux);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (duration) && duration > 0) {
|
if (GST_CLOCK_TIME_IS_VALID (duration) && duration > 0) {
|
||||||
|
@ -2220,12 +2219,12 @@ gst_adaptive_demux_update_manifest (GstAdaptiveDemux * demux)
|
||||||
g_object_unref (download);
|
g_object_unref (download);
|
||||||
ret = klass->update_manifest (demux, buffer);
|
ret = klass->update_manifest (demux, buffer);
|
||||||
if (ret == GST_FLOW_OK) {
|
if (ret == GST_FLOW_OK) {
|
||||||
|
GstClockTime duration;
|
||||||
gst_buffer_unref (demux->priv->manifest_buffer);
|
gst_buffer_unref (demux->priv->manifest_buffer);
|
||||||
demux->priv->manifest_buffer = buffer;
|
demux->priv->manifest_buffer = buffer;
|
||||||
|
|
||||||
/* Send an updated duration message */
|
/* Send an updated duration message */
|
||||||
if (klass->get_duration) {
|
duration = klass->get_duration (demux);
|
||||||
GstClockTime duration = klass->get_duration (demux);
|
|
||||||
|
|
||||||
GST_MANIFEST_UNLOCK (demux);
|
GST_MANIFEST_UNLOCK (demux);
|
||||||
if (duration != GST_CLOCK_TIME_NONE) {
|
if (duration != GST_CLOCK_TIME_NONE) {
|
||||||
|
@ -2238,9 +2237,6 @@ gst_adaptive_demux_update_manifest (GstAdaptiveDemux * demux)
|
||||||
GST_DEBUG_OBJECT (demux,
|
GST_DEBUG_OBJECT (demux,
|
||||||
"Duration unknown, can not send the duration message");
|
"Duration unknown, can not send the duration message");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
GST_MANIFEST_UNLOCK (demux);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
GST_MANIFEST_UNLOCK (demux);
|
GST_MANIFEST_UNLOCK (demux);
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
Loading…
Reference in a new issue