mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
playbin2: Reset stream segments on FLUSH_STOP and don't adjust QoS events for non-time segments
This commit is contained in:
parent
56d3856620
commit
930a57db20
1 changed files with 20 additions and 14 deletions
|
@ -2370,7 +2370,8 @@ _playsink_src_event_probe_cb (GstPad * pad, GstEvent * event,
|
|||
return TRUE;
|
||||
|
||||
/* If we have no group start accumulator yet, this is
|
||||
* a QOS event for the previous group
|
||||
* a QOS event for the previous group or this stream
|
||||
* has a non-time segment.
|
||||
*/
|
||||
if (!GST_CLOCK_TIME_IS_VALID (group_start_accum))
|
||||
return FALSE;
|
||||
|
@ -2414,14 +2415,7 @@ static gboolean
|
|||
_playsink_sink_event_probe_cb (GstPad * pad, GstEvent * event,
|
||||
PlaySinkEventProbeData * data)
|
||||
{
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT) {
|
||||
GstPlayBin *playbin = data->playbin;
|
||||
GstSegment *segment;
|
||||
guint index;
|
||||
gboolean update;
|
||||
GstFormat format;
|
||||
gdouble rate, applied_rate;
|
||||
gint64 start, stop, pos;
|
||||
|
||||
if (data->type == GST_PLAY_SINK_TYPE_VIDEO
|
||||
|| data->type == GST_PLAY_SINK_TYPE_VIDEO_RAW)
|
||||
|
@ -2434,6 +2428,14 @@ _playsink_sink_event_probe_cb (GstPad * pad, GstEvent * event,
|
|||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT) {
|
||||
GstPlayBin *playbin = data->playbin;
|
||||
GstSegment *segment;
|
||||
gboolean update;
|
||||
GstFormat format;
|
||||
gdouble rate, applied_rate;
|
||||
gint64 start, stop, pos;
|
||||
|
||||
segment = &playbin->segments[index];
|
||||
|
||||
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
|
||||
|
@ -2443,9 +2445,13 @@ _playsink_sink_event_probe_cb (GstPad * pad, GstEvent * event,
|
|||
gst_segment_set_newsegment_full (segment, update, rate, applied_rate,
|
||||
format, start, stop, pos);
|
||||
|
||||
if (!GST_CLOCK_TIME_IS_VALID (data->group->selector[data->
|
||||
if (format != GST_FORMAT_TIME)
|
||||
data->group->selector[data->type].group_start_accum = GST_CLOCK_TIME_NONE;
|
||||
else if (!GST_CLOCK_TIME_IS_VALID (data->group->selector[data->
|
||||
type].group_start_accum))
|
||||
data->group->selector[data->type].group_start_accum = segment->accum;
|
||||
} else if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) {
|
||||
gst_segment_init (&data->playbin->segments[index], GST_FORMAT_UNDEFINED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue