- copy offset from input buffer

Original commit message from CVS:
- copy offset from input buffer
This commit is contained in:
Wim Taymans 2003-05-29 12:41:42 +00:00
parent 6b8b864541
commit b27556d018

View file

@ -681,7 +681,10 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf)
"encoded %d bytes of audio to %d bytes of mp3",
GST_BUFFER_SIZE (buf), mp3_size);
if (lame->last_ts == GST_CLOCK_TIME_NONE) {
lame->last_ts = GST_BUFFER_TIMESTAMP (buf);
lame->last_offs = GST_BUFFER_OFFSET (buf);
}
gst_buffer_unref (buf);
}
@ -691,8 +694,11 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf)
GST_BUFFER_DATA (outbuf) = mp3_data;
GST_BUFFER_SIZE (outbuf) = mp3_size;
GST_BUFFER_TIMESTAMP (outbuf) = lame->last_ts;
GST_BUFFER_OFFSET (outbuf) = lame->last_offs;
gst_pad_push (lame->srcpad,outbuf);
lame->last_ts = GST_CLOCK_TIME_NONE;
}
else {
g_free (mp3_data);
@ -784,7 +790,7 @@ gst_lame_change_state (GstElement *element)
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_READY_TO_PAUSED:
lame->last_ts = 0;
lame->last_ts = GST_CLOCK_TIME_NONE;
break;
case GST_STATE_READY_TO_NULL:
if (lame->initialized) {