summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStian Selnes <stian.selnes@gmail.com>2014-06-16 17:20:32 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-01 20:21:40 +0200
commitcbd13883a8ea2a78f881bf043a35b5e978ed18cc (patch)
treea2573610a85f8cc3a0785af34db5c23701dfb311
parent78ab8cbdcd0b0bca80dfd3eeb0601a8c41207149 (diff)
rtph263depay: Don't drop mode b packets with picture start code
Some buggy payloaders, e.g. rtph263pay, may use mode B for packets that starts with a picture (or GOB) start code although it's not allowed. Let's be nice and not drop these packets/frames. https://bugzilla.gnome.org/show_bug.cgi?id=773516
-rw-r--r--gst/rtp/gstrtph263depay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/rtp/gstrtph263depay.c b/gst/rtp/gstrtph263depay.c
index 0f1bed7e5..c45639a82 100644
--- a/gst/rtp/gstrtph263depay.c
+++ b/gst/rtp/gstrtph263depay.c
@@ -310,9 +310,10 @@ gst_rtp_h263_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
payload_len -= header_len;
if (!rtph263depay->start) {
- /* do not skip this fragment if it is a Mode A with picture start code */
- if (!F && payload_len > 4 && (GST_READ_UINT32_BE (payload) >> 10 == 0x20)) {
- GST_DEBUG ("Mode A with PSC => frame start");
+ /* only mode A should be used when there is a picture start code, but
+ * buggy payloaders may send mode B/C in start of frame */
+ if (payload_len > 4 && (GST_READ_UINT32_BE (payload) >> 10 == 0x20)) {
+ GST_DEBUG ("Mode %c with PSC => frame start", "ABC"[F+P]);
rtph263depay->start = TRUE;
if ((! !(payload[4] & 0x02)) != I) {
GST_DEBUG ("Wrong Picture Coding Type Flag in rtp header");