mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
- use _merge instead of _append
Original commit message from CVS: - use _merge instead of _append - unref events
This commit is contained in:
parent
6d3a854cb1
commit
562ae61a61
3 changed files with 11 additions and 6 deletions
|
@ -258,7 +258,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
|||
/* if we have something left from the previous frame */
|
||||
if (mp3parse->partialbuf) {
|
||||
|
||||
mp3parse->partialbuf = gst_buffer_append(mp3parse->partialbuf, buf);
|
||||
mp3parse->partialbuf = gst_buffer_merge(mp3parse->partialbuf, buf);
|
||||
/* and the one we received.. */
|
||||
gst_buffer_unref(buf);
|
||||
}
|
||||
|
|
|
@ -380,13 +380,15 @@ gst_mpeg_parse_loop (GstElement *element)
|
|||
mpeg_parse->discont_pending = TRUE;
|
||||
mpeg_parse->scr_pending = TRUE;
|
||||
mpeg_parse->packetize->resync = TRUE;
|
||||
gst_event_free (event);
|
||||
gst_event_unref (event);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (CLASS (mpeg_parse)->send_data)
|
||||
CLASS (mpeg_parse)->send_data (mpeg_parse, data, time);
|
||||
else
|
||||
gst_event_unref (event);
|
||||
}
|
||||
else {
|
||||
guint64 size;
|
||||
|
@ -498,6 +500,7 @@ gst_mpeg_parse_handle_src_event (GstPad *pad, GstEvent *event)
|
|||
guint64 desired_offset;
|
||||
|
||||
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_TIME) {
|
||||
gst_event_unref (event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -506,6 +509,7 @@ gst_mpeg_parse_handle_src_event (GstPad *pad, GstEvent *event)
|
|||
desired_offset = mpeg_parse->bit_rate * GST_EVENT_SEEK_OFFSET (event) / (8 * GST_SECOND);
|
||||
|
||||
if (!gst_bytestream_seek (mpeg_parse->packetize->bs, desired_offset, GST_SEEK_METHOD_SET)) {
|
||||
gst_event_unref (event);
|
||||
return FALSE;
|
||||
}
|
||||
mpeg_parse->discont_pending = TRUE;
|
||||
|
@ -517,6 +521,7 @@ gst_mpeg_parse_handle_src_event (GstPad *pad, GstEvent *event)
|
|||
break;
|
||||
}
|
||||
|
||||
gst_event_unref (event);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ gst_rfc2250_enc_add_slice (GstRFC2250Enc *enc, GstBuffer *buffer)
|
|||
|
||||
/* see if the slice fits in the current buffer */
|
||||
if (slice_length <= enc->remaining) {
|
||||
gst_buffer_append (enc->packet, buffer);
|
||||
gst_buffer_merge (enc->packet, buffer);
|
||||
gst_buffer_unref (buffer);
|
||||
enc->remaining -= slice_length;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ gst_rfc2250_enc_add_slice (GstRFC2250Enc *enc, GstBuffer *buffer)
|
|||
/* do we need to start a new packet? */
|
||||
if (slice_length <= enc->MTU) {
|
||||
gst_rfc2250_enc_new_buffer (enc);
|
||||
gst_buffer_append (enc->packet, buffer);
|
||||
gst_buffer_merge (enc->packet, buffer);
|
||||
gst_buffer_unref (buffer);
|
||||
enc->remaining -= slice_length;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ gst_rfc2250_enc_add_slice (GstRFC2250Enc *enc, GstBuffer *buffer)
|
|||
GstBuffer *outbuf;
|
||||
|
||||
outbuf = gst_buffer_create_sub (buffer, offset, MIN (enc->remaining, slice_length));
|
||||
gst_buffer_append (enc->packet, outbuf);
|
||||
gst_buffer_merge (enc->packet, outbuf);
|
||||
slice_length -= GST_BUFFER_SIZE (outbuf);
|
||||
offset += GST_BUFFER_SIZE (outbuf);
|
||||
gst_buffer_unref (outbuf);
|
||||
|
@ -251,7 +251,7 @@ gst_rfc2250_enc_loop (GstElement *element)
|
|||
|
||||
}
|
||||
if (buffer) {
|
||||
gst_buffer_append (enc->packet, buffer);
|
||||
gst_buffer_merge (enc->packet, buffer);
|
||||
enc->remaining -= GST_BUFFER_SIZE (buffer);
|
||||
gst_buffer_unref (buffer);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue