From 6ee4b31c0e67af952d8848f67460ba8aae10d2d9 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 7 Jul 2015 23:56:12 -0300 Subject: [PATCH] qtdemux: rename upstream_newsegment to upstream_format_is_time upstream_newsegment isn't really clear on what it means, it is set to TRUE when the upstream element sends a segment in TIME format, so rename it to be more clear about it. It is important to know this because it means that upstream has a notion of time and qtdemux is likely being driven by an upstream element that is reading from a higher level abstraction than a file, such as a DASH, MSS or DLNA element. --- gst/isomp4/qtdemux.c | 12 ++++++------ gst/isomp4/qtdemux.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index d352653..8b01973 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -576,7 +576,7 @@ gst_qtdemux_init (GstQTDemux * qtdemux) qtdemux->exposed = FALSE; qtdemux->mss_mode = FALSE; qtdemux->pending_newsegment = NULL; - qtdemux->upstream_newsegment = FALSE; + qtdemux->upstream_format_is_time = FALSE; qtdemux->have_group_id = FALSE; qtdemux->group_id = G_MAXUINT; gst_segment_init (&qtdemux->segment, GST_FORMAT_TIME); @@ -1600,7 +1600,7 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstObject * parent, GstClockTime ts = gst_util_get_timestamp (); #endif - if (qtdemux->upstream_newsegment && qtdemux->fragmented) { + if (qtdemux->upstream_format_is_time && qtdemux->fragmented) { /* seek should be handled by upstream, we might need to re-download fragments */ GST_DEBUG_OBJECT (qtdemux, "let upstream handle seek for fragmented playback"); @@ -1845,7 +1845,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard) GST_DEBUG_OBJECT (qtdemux, "Resetting demux"); gst_pad_stop_task (qtdemux->sinkpad); - if (hard || qtdemux->upstream_newsegment) { + if (hard || qtdemux->upstream_format_is_time) { qtdemux->state = QTDEMUX_STATE_INITIAL; qtdemux->neededbytes = 16; qtdemux->todrop = 0; @@ -1882,7 +1882,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard) if (qtdemux->pending_newsegment) gst_event_unref (qtdemux->pending_newsegment); qtdemux->pending_newsegment = NULL; - qtdemux->upstream_newsegment = FALSE; + qtdemux->upstream_format_is_time = FALSE; qtdemux->upstream_seekable = FALSE; qtdemux->upstream_size = 0; @@ -1954,7 +1954,7 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent, if (segment.format == GST_FORMAT_TIME) { GST_DEBUG_OBJECT (demux, "new pending_newsegment"); gst_event_replace (&demux->pending_newsegment, event); - demux->upstream_newsegment = TRUE; + demux->upstream_format_is_time = TRUE; } else { GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, " "not in time format"); @@ -2044,7 +2044,7 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent, demux->neededbytes = demux->todrop + stream->samples[idx].size; } else { /* set up for EOS */ - if (demux->upstream_newsegment) { + if (demux->upstream_format_is_time) { demux->neededbytes = 16; } else { demux->neededbytes = -1; diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h index 6345d9c..b232d49 100644 --- a/gst/isomp4/qtdemux.h +++ b/gst/isomp4/qtdemux.h @@ -117,10 +117,10 @@ struct _GstQTDemux { /* configured playback region */ GstSegment segment; GstEvent *pending_newsegment; - gboolean upstream_newsegment; /* qtdemux received upstream - * newsegment in TIME format which likely - * means that upstream is driving the pipeline - * (adaptive demuxers) */ + gboolean upstream_format_is_time; /* qtdemux received upstream + * newsegment in TIME format which likely + * means that upstream is driving the pipeline + * (adaptive demuxers / dlna) */ gint64 seek_offset; gint64 push_seek_start; gint64 push_seek_stop; -- 2.7.4