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
This commit is contained in:
Stian Selnes 2014-06-16 17:20:32 +02:00 committed by Sebastian Dröge
parent 78ab8cbdcd
commit cbd13883a8

View file

@ -310,9 +310,10 @@ gst_rtp_h263_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
payload_len -= header_len; payload_len -= header_len;
if (!rtph263depay->start) { if (!rtph263depay->start) {
/* do not skip this fragment if it is a Mode A with picture start code */ /* only mode A should be used when there is a picture start code, but
if (!F && payload_len > 4 && (GST_READ_UINT32_BE (payload) >> 10 == 0x20)) { * buggy payloaders may send mode B/C in start of frame */
GST_DEBUG ("Mode A with PSC => frame start"); 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; rtph263depay->start = TRUE;
if ((! !(payload[4] & 0x02)) != I) { if ((! !(payload[4] & 0x02)) != I) {
GST_DEBUG ("Wrong Picture Coding Type Flag in rtp header"); GST_DEBUG ("Wrong Picture Coding Type Flag in rtp header");