port to new API

This commit is contained in:
Wim Taymans 2011-08-03 18:37:27 +02:00
parent 4121021bb2
commit ee2aa25e04
3 changed files with 17 additions and 7 deletions

View file

@ -1822,20 +1822,30 @@ gst_pulsesink_payload (GstBaseAudioSink * sink, GstBuffer * buf)
/* FIXME: alloc memory from PA if possible */
gint framesize = gst_audio_iec61937_frame_size (&sink->ringbuffer->spec);
GstBuffer *out;
guint8 *indata, *outdata;
gsize insize, outsize;
gboolean res;
if (framesize <= 0)
return NULL;
out = gst_buffer_new_and_alloc (framesize);
if (!gst_audio_iec61937_payload (GST_BUFFER_DATA (buf),
GST_BUFFER_SIZE (buf), GST_BUFFER_DATA (out),
GST_BUFFER_SIZE (out), &sink->ringbuffer->spec)) {
indata = gst_buffer_map (buf, &insize, NULL, GST_MAP_READ);
outdata = gst_buffer_map (out, &outsize, NULL, GST_MAP_WRITE);
res = gst_audio_iec61937_payload (indata, insize,
outdata, outsize, &sink->ringbuffer->spec);
gst_buffer_unmap (buf, indata, insize);
gst_buffer_unmap (out, outdata, outsize);
if (!res) {
gst_buffer_unref (out);
return NULL;
}
gst_buffer_copy_metadata (out, buf, GST_BUFFER_COPY_ALL);
gst_buffer_copy_into (out, buf, GST_BUFFER_COPY_METADATA, 0, -1);
return out;
}

View file

@ -553,8 +553,7 @@ gst_ac3_parse_check_valid_frame (GstBaseParse * parse,
do {
*framesize += frmsiz;
if (!gst_byte_reader_skip (&reader, frmsiz) ||
GST_BUFFER_SIZE (buf) < (*framesize + 6)) {
if (!gst_byte_reader_skip (&reader, frmsiz) || size < (*framesize + 6)) {
more = TRUE;
break;
}

View file

@ -609,7 +609,7 @@ gst_rtp_h264_push_fragmentation_unit (GstRtpH264Depay * rtph264depay)
outsize = gst_adapter_available (rtph264depay->adapter);
outbuf = gst_adapter_take_buffer (rtph264depay->adapter, outsize);
outdata = GST_BUFFER_DATA (outbuf);
outdata = gst_buffer_map (outbuf, NULL, NULL, GST_MAP_WRITE);
GST_DEBUG_OBJECT (rtph264depay, "output %d bytes", outsize);
@ -622,6 +622,7 @@ gst_rtp_h264_push_fragmentation_unit (GstRtpH264Depay * rtph264depay)
outdata[2] = (outsize >> 8);
outdata[3] = (outsize);
}
gst_buffer_unmap (outbuf, outdata, -1);
gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf,
rtph264depay->fu_timestamp, rtph264depay->fu_marker);