summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-16 15:06:11 (GMT)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-30 11:49:54 (GMT)
commit84ac277add7ba47d0960799b2b08a55dc094d37b (patch)
tree667ca7f70ccd9a1eb5ff38838dcce58754fefc04
parente7903311f54e106ee42cf2f61e9724b00d15652d (diff)
rtph263depay: detect frame start using Picture Start Code
So we stop dropping fragments as soon as there is a picture start (code). In particular, this prevents dropping the first frame following initial DISCONT.
-rw-r--r--gst/rtp/gstrtph263depay.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gst/rtp/gstrtph263depay.c b/gst/rtp/gstrtph263depay.c
index f061e97..2f49567 100644
--- a/gst/rtp/gstrtph263depay.c
+++ b/gst/rtp/gstrtph263depay.c
@@ -248,15 +248,21 @@ gst_rtp_h263_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
GST_LOG ("payload_len : %d, header_len : %d , leftover : 0x%x",
payload_len, header_len, rtph263depay->leftover);
- if (G_UNLIKELY (!rtph263depay->start)) {
- GST_DEBUG ("no frame start yet, skipping payload");
- goto skip;
- }
-
/* skip header */
payload += header_len;
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");
+ rtph263depay->start = TRUE;
+ } else {
+ GST_DEBUG ("no frame start yet, skipping payload");
+ goto skip;
+ }
+ }
+
if (SBIT) {
/* take the leftover and merge it at the beginning, FIXME make the buffer
* data writable. */