diff options
author | Edward Hervey <edward@centricular.com> | 2015-11-23 15:11:58 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2016-06-30 14:58:03 +0200 |
commit | e5f381b96a9abbb4e00b8c200d5006a35d982a4f (patch) | |
tree | bc60f2e2309c24b40963c9534d4282849b4372a8 /validate/tools | |
parent | 07993977682a7f6998823bd50c5ff0574cfa9d08 (diff) |
validate: Use presence of STREAM_START to detect track switching
When doing a track switch, the only reliable way to detect that it
happened is whether a new STREAM_START arrives.
Relying on a DISCONT buffer is not satisfactory, since there might
not have been an element setting that flag upstream.
Checking whether the first buffer after a STREAM_START has the
DISCONT flag properly set should be done in parallel
Diffstat (limited to 'validate/tools')
-rw-r--r-- | validate/tools/gst-validate.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index ca880cf..a608db5 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -257,15 +257,13 @@ _execute_set_subtitles (GstValidateScenario * scenario, } static GstPadProbeReturn -_check_pad_selection_done (GstPad * pad, GstPadProbeInfo * info, +_check_pad_event_selection_done (GstPad * pad, GstPadProbeInfo * info, GstValidateAction * action) { - if (GST_BUFFER_FLAG_IS_SET (info->data, GST_BUFFER_FLAG_DISCONT)) { + if (GST_EVENT_TYPE (info->data) == GST_EVENT_STREAM_START) { gst_validate_action_set_done (action); - return GST_PAD_PROBE_REMOVE; } - return GST_PAD_PROBE_OK; } @@ -350,8 +348,9 @@ _execute_switch_track (GstValidateScenario * scenario, if (srcpad) { gst_pad_add_probe (srcpad, - GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST, - (GstPadProbeCallback) _check_pad_selection_done, action, NULL); + GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, + (GstPadProbeCallback) _check_pad_event_selection_done, action, + NULL); gst_object_unref (srcpad); res = GST_VALIDATE_EXECUTE_ACTION_ASYNC; |