mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
pad-monitor: make it able to initialize a segment
Do not take the initial format set to TIME too seriously when we haven't got any newsegment event yet. If it is the first segment received, switch our internal segment tracker to the event format
This commit is contained in:
parent
7de70978cf
commit
08180f3a4c
2 changed files with 5 additions and 0 deletions
|
@ -186,8 +186,12 @@ gst_qa_pad_monitor_event_func (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_NEWSEGMENT:
|
||||
if (ret) {
|
||||
if (!pad_monitor->has_segment && pad_monitor->segment.format != format) {
|
||||
gst_segment_init (&pad_monitor->segment, format);
|
||||
}
|
||||
gst_segment_set_newsegment_full (&pad_monitor->segment, update, rate,
|
||||
applied_rate, format, start, stop, position);
|
||||
pad_monitor->has_segment = TRUE;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_FLUSH_START:
|
||||
|
|
|
@ -63,6 +63,7 @@ struct _GstQaPadMonitor {
|
|||
GstPadQueryFunction query_func;
|
||||
|
||||
/*< private >*/
|
||||
gboolean has_segment;
|
||||
GstSegment segment;
|
||||
|
||||
gboolean pending_flush_stop;
|
||||
|
|
Loading…
Reference in a new issue