rtpsource: allow for NULL caps on buffers
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 28 Jul 2009 16:18:20 +0000 (18:18 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 28 Jul 2009 16:18:20 +0000 (18:18 +0200)
Add the NULL caps check where it matters and also cover another case of
potential NULL caps.

Fixes #590030

gst/rtpmanager/rtpsource.c

index 77d56c2..1e0b6c0 100644 (file)
@@ -628,7 +628,7 @@ rtp_source_update_caps (RTPSource * src, GstCaps * caps)
   gint ival;
 
   /* nothing changed, return */
-  if (src->caps == caps)
+  if (caps == NULL || src->caps == caps)
     return;
 
   s = gst_caps_get_structure (caps, 0);
@@ -981,8 +981,7 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
 
   seqnr = gst_rtp_buffer_get_seq (buffer);
 
-  if (GST_BUFFER_CAPS (buffer))
-    rtp_source_update_caps (src, GST_BUFFER_CAPS (buffer));
+  rtp_source_update_caps (src, GST_BUFFER_CAPS (buffer));
 
   if (stats->cycles == -1) {
     GST_DEBUG ("received first buffer");