- use _merge instead of _append

Original commit message from CVS:
- use _merge instead of _append
- fix events in modplug
This commit is contained in:
Wim Taymans 2002-07-08 19:42:06 +00:00
parent fe3270c356
commit 47043705b3
3 changed files with 21 additions and 5 deletions

View file

@ -360,6 +360,7 @@ gst_modplug_src_event (GstPad *pad, GstEvent *event)
res = FALSE;
break;
}
gst_event_unref (event);
return res;
}
@ -385,17 +386,26 @@ gst_modplug_loop (GstElement *element)
if ( GST_IS_EVENT (buffer_in) ) {
GstEvent *event = GST_EVENT (buffer_in);
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
gst_event_unref (event);
break;
}
gst_event_unref (event);
}
else
{
if ( modplug->Buffer ) {
modplug->Buffer = gst_buffer_append( modplug->Buffer, buffer_in );
GstBuffer *merge;
merge = gst_buffer_merge( modplug->Buffer, buffer_in );
gst_buffer_unref( buffer_in );
gst_buffer_unref( modplug->Buffer );
modplug->Buffer = merge;
}
else
else {
modplug->Buffer = buffer_in;
}
}
}

View file

@ -257,9 +257,15 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
if (mp1videoparse->partialbuf) {
GstBuffer *merge;
offset = GST_BUFFER_SIZE(mp1videoparse->partialbuf);
mp1videoparse->partialbuf = gst_buffer_append(mp1videoparse->partialbuf, buf);
merge = gst_buffer_merge(mp1videoparse->partialbuf, buf);
gst_buffer_unref(mp1videoparse->partialbuf);
gst_buffer_unref(buf);
mp1videoparse->partialbuf = merge;
}
else {
mp1videoparse->partialbuf = buf;

View file

@ -366,7 +366,7 @@ gst_mpeg2subt_chain_subtitle (GstPad *pad, GstBuffer *buf)
/* deal with partial frame from previous buffer */
if (mpeg2subt->partialbuf) {
mpeg2subt->partialbuf = gst_buffer_append(mpeg2subt->partialbuf, buf);;
mpeg2subt->partialbuf = gst_buffer_merge(mpeg2subt->partialbuf, buf);;
/* and the one we received.. */
gst_buffer_unref(buf);
}