h264parse: Return flushing if we get chained while being set to READY
authorThibault Saunier <tsaunier@gnome.org>
Tue, 29 Jul 2014 14:12:26 +0000 (16:12 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 24 Sep 2014 17:21:18 +0000 (19:21 +0200)
Or not negotiated in the case we would be actually not negotiated

Currently we are getting assertions from
gst_pb_utils_add_codec_description_to_tag_list because of NULL
caps.

https://bugzilla.gnome.org/show_bug.cgi?id=737186

gst/videoparsers/gsth264parse.c

index 360fc5b..89b33d5 100644 (file)
@@ -1680,6 +1680,15 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
 
     /* codec tag */
     caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
+    if (caps == NULL) {
+      if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (h264parse))) {
+        GST_INFO_OBJECT (h264parse, "Src pad is flushing");
+        return GST_FLOW_FLUSHING;
+      } else {
+        GST_INFO_OBJECT (h264parse, "Src pad is not negotiated!");
+        return GST_FLOW_NOT_NEGOTIATED;
+      }
+    }
     gst_pb_utils_add_codec_description_to_tag_list (taglist,
         GST_TAG_VIDEO_CODEC, caps);
     gst_caps_unref (caps);