/* We don't bother with fragmented packets yet */
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1);
- GST_DEBUG_OBJECT (rtpac3depay, "pushing buffer of size %d",
- GST_BUFFER_SIZE (outbuf));
+ if (outbuf)
+ GST_DEBUG_OBJECT (rtpac3depay, "pushing buffer of size %d",
+ GST_BUFFER_SIZE (outbuf));
return outbuf;
}
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- if (marker) {
+ if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
}
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
marker = gst_rtp_buffer_get_marker (buf);
- if (marker) {
+ if (marker && outbuf) {
/* mark talk spurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
}
if (depay->aal2 || depay->force_aal2) {
/* AAL2, we can just copy the bytes */
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
+ if (!outbuf)
+ goto bad_len;
} else {
guint8 *in, *out, tmp;
guint len;
outbuf = gst_rtp_buffer_get_payload_buffer (copy);
gst_buffer_unref (copy);
}
+
+ if (!outbuf)
+ goto bad_len;
+
out = GST_BUFFER_DATA (outbuf);
/* we need to reshuffle the bytes, input is always of the form
}
return outbuf;
+
+bad_len:
+ return NULL;
}
static void
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- if (marker) {
+ if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
}
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- if (marker) {
+ if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
}
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- GST_DEBUG ("gst_rtp_mp1s_depay_chain: pushing buffer of size %d",
- GST_BUFFER_SIZE (outbuf));
+ if (outbuf)
+ GST_DEBUG ("gst_rtp_mp1s_depay_chain: pushing buffer of size %d",
+ GST_BUFFER_SIZE (outbuf));
return outbuf;
}
gst_rtp_buffer_get_payload_subbuffer (buf, rtpmp2tdepay->skip_first_bytes,
-1);
- GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %d",
- GST_BUFFER_SIZE (outbuf));
+ if (outbuf)
+ GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %d",
+ GST_BUFFER_SIZE (outbuf));
return outbuf;
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, payload_header, -1);
- GST_DEBUG_OBJECT (rtpmpvdepay,
- "gst_rtp_mpv_depay_chain: pushing buffer of size %d",
- GST_BUFFER_SIZE (outbuf));
+ if (outbuf) {
+ GST_DEBUG_OBJECT (rtpmpvdepay,
+ "gst_rtp_mpv_depay_chain: pushing buffer of size %d",
+ GST_BUFFER_SIZE (outbuf));
+ }
return outbuf;
}
len = gst_rtp_buffer_get_payload_len (buf);
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- GST_BUFFER_DURATION (outbuf) =
- gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
-
- if (marker) {
- /* mark start of talkspurt with DISCONT */
- GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ if (outbuf) {
+ GST_BUFFER_DURATION (outbuf) =
+ gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
+
+ if (marker) {
+ /* mark start of talkspurt with DISCONT */
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ }
}
return outbuf;
len = gst_rtp_buffer_get_payload_len (buf);
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- GST_BUFFER_DURATION (outbuf) =
- gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
-
- if (marker) {
- /* mark start of talkspurt with DISCONT */
- GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ if (outbuf) {
+ GST_BUFFER_DURATION (outbuf) =
+ gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
+
+ if (marker) {
+ /* mark start of talkspurt with DISCONT */
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ }
}
return outbuf;
/* nothing special to be done */
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
- GST_BUFFER_DURATION (outbuf) = 20 * GST_MSECOND;
+ if (outbuf)
+ GST_BUFFER_DURATION (outbuf) = 20 * GST_MSECOND;
return outbuf;
}