gst/qtdemux/gstrtpxqtdepay.*: Fail if we don't know the quicktime format.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 26 Sep 2007 14:26:39 +0000 (14:26 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 26 Sep 2007 14:26:39 +0000 (14:26 +0000)
Original commit message from CVS:
* gst/qtdemux/gstrtpxqtdepay.c: (gst_rtp_xqt_depay_process),
(gst_rtp_xqt_depay_change_state):
* gst/qtdemux/gstrtpxqtdepay.h:
Fail if we don't know the quicktime format.

ChangeLog
gst/qtdemux/gstrtpxqtdepay.c
gst/qtdemux/gstrtpxqtdepay.h

index 647b853dce2d04c9ed538cb17229e1542f6be592..69c23900ff80dfa6e720d0703755f234dfbee33d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-26  Wim Taymans  <wim.taymans@gmail.com>
+
+       * gst/qtdemux/gstrtpxqtdepay.c: (gst_rtp_xqt_depay_process),
+       (gst_rtp_xqt_depay_change_state):
+       * gst/qtdemux/gstrtpxqtdepay.h:
+       Fail if we don't know the quicktime format.
+
 2007-09-26  Tim-Philipp Müller  <tim at centricular dot net>
 
        * ext/flac/gstflacenc.c:
index 0a147ef4961ab80e87d7989fc62900e3e48667fa..4cd9257f408132c97c1b669079b05cd4aaea6360 100644 (file)
@@ -282,6 +282,7 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
     /* discont, clear adapter and try to find a new packet start */
     gst_adapter_clear (rtpxqtdepay->adapter);
     rtpxqtdepay->need_resync = TRUE;
+    GST_DEBUG_OBJECT (rtpxqtdepay, "we need resync");
   }
 
   m = gst_rtp_buffer_get_marker (buf);
@@ -435,7 +436,9 @@ gst_rtp_xqt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
         switch (tlv_type) {
           case TLV_sd:
             /* Session description */
-            gst_rtp_quicktime_parse_sd (rtpxqtdepay, payload, tlv_len);
+            if (!gst_rtp_quicktime_parse_sd (rtpxqtdepay, payload, tlv_len))
+              goto unknown_format;
+            rtpxqtdepay->have_sd = TRUE;
             break;
           case TLV_qt:
           case TLV_ti:
@@ -665,6 +668,12 @@ wrong_length:
         ("Wrong payload length."), (NULL));
     return NULL;
   }
+unknown_format:
+  {
+    GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
+        ("Unknown payload format."), (NULL));
+    return NULL;
+  }
 }
 
 static void
@@ -710,7 +719,8 @@ gst_rtp_xqt_depay_change_state (GstElement * element, GstStateChange transition)
       gst_adapter_clear (rtpxqtdepay->adapter);
       rtpxqtdepay->previous_id = -1;
       rtpxqtdepay->current_id = -1;
-      rtpxqtdepay->need_resync = FALSE;
+      rtpxqtdepay->need_resync = TRUE;
+      rtpxqtdepay->have_sd = FALSE;
       break;
     default:
       break;
index 23cf6eea5c296fe944ce532c07fe61dae42ea798..4b8a6df8b3f0dd66f19d47a4f6d97df63ff8e220 100644 (file)
@@ -49,6 +49,7 @@ struct _GstRtpXQTDepay
   gboolean need_resync;
   guint16 previous_id;
   guint16 current_id;
+  gboolean have_sd;
 };
 
 struct _GstRtpXQTDepayClass