pad-monitor: only expect a new segment if pad is running on push mode
authorThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 23 Jul 2013 15:52:22 +0000 (12:52 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 23 Jul 2013 15:52:22 +0000 (12:52 -0300)
For pull mode, it should just provide the buffers, regardless of getting
a new segment or not

validate/gst/qa/gst-qa-pad-monitor.c

index 6c7ad42f3afd534611e14271939889d5e7430215..0371e528fe3b0cee17351d8429a5a93bdb35ef22 100644 (file)
@@ -40,6 +40,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_qa_pad_monitor_debug);
 G_DEFINE_TYPE_WITH_CODE (GstQaPadMonitor, gst_qa_pad_monitor,
     GST_TYPE_QA_MONITOR, _do_init);
 
+#define PAD_IS_IN_PUSH_MODE(p) ((p)->mode == GST_ACTIVATE_PUSH)
 #define PENDING_FIELDS "pending-fields"
 
 typedef struct
@@ -525,7 +526,8 @@ gst_qa_pad_monitor_check_first_buffer (GstQaPadMonitor * pad_monitor,
   if (G_UNLIKELY (pad_monitor->first_buffer)) {
     pad_monitor->first_buffer = FALSE;
 
-    if (!pad_monitor->has_segment) {
+    if (!pad_monitor->has_segment
+        && PAD_IS_IN_PUSH_MODE (GST_QA_PAD_MONITOR_GET_PAD (pad_monitor))) {
       GST_QA_MONITOR_REPORT_WARNING (pad_monitor, FALSE, EVENT, EXPECTED,
           "Received buffer before Segment event");
     }