unref events free buffer in vorbisfile if it cannot be pushed
Original commit message from CVS: unref events free buffer in vorbisfile if it cannot be pushed
This commit is contained in:
parent
59cbd4e443
commit
1be255a154
@ -243,6 +243,7 @@ gst_vorbisfile_read (void *ptr, size_t size, size_t nmemb, void *datasource)
|
|||||||
GST_DEBUG (0, "eos");
|
GST_DEBUG (0, "eos");
|
||||||
vorbisfile->eos = TRUE;
|
vorbisfile->eos = TRUE;
|
||||||
if (avail == 0) {
|
if (avail == 0) {
|
||||||
|
gst_event_unref (event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -252,6 +253,7 @@ gst_vorbisfile_read (void *ptr, size_t size, size_t nmemb, void *datasource)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
gst_event_unref (event);
|
||||||
if (avail > 0)
|
if (avail > 0)
|
||||||
got_bytes = gst_bytestream_peek_bytes (vorbisfile->bs, &data, avail);
|
got_bytes = gst_bytestream_peek_bytes (vorbisfile->bs, &data, avail);
|
||||||
else
|
else
|
||||||
@ -419,6 +421,7 @@ gst_vorbisfile_loop (GstElement *element)
|
|||||||
GST_DEBUG (0, "eos");
|
GST_DEBUG (0, "eos");
|
||||||
//ov_clear (&vorbisfile->vf);
|
//ov_clear (&vorbisfile->vf);
|
||||||
vorbisfile->restart = TRUE;
|
vorbisfile->restart = TRUE;
|
||||||
|
gst_buffer_unref (outbuf);
|
||||||
gst_pad_push (vorbisfile->srcpad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
|
gst_pad_push (vorbisfile->srcpad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
|
||||||
gst_element_set_eos (element);
|
gst_element_set_eos (element);
|
||||||
return;
|
return;
|
||||||
@ -463,7 +466,12 @@ gst_vorbisfile_loop (GstElement *element)
|
|||||||
vorbisfile->total_bytes += GST_BUFFER_SIZE (outbuf);
|
vorbisfile->total_bytes += GST_BUFFER_SIZE (outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_pad_push (vorbisfile->srcpad, outbuf);
|
if (GST_PAD_IS_CONNECTED (vorbisfile->srcpad)) {
|
||||||
|
gst_pad_push (vorbisfile->srcpad, outbuf);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gst_buffer_unref (outbuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -556,8 +564,10 @@ gst_vorbisfile_src_event (GstPad *pad, GstEvent *event)
|
|||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
if (!vorbisfile->vf.seekable)
|
if (!vorbisfile->vf.seekable) {
|
||||||
|
gst_event_unref (event);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (GST_EVENT_SEEK_FORMAT (event)) {
|
switch (GST_EVENT_SEEK_FORMAT (event)) {
|
||||||
case GST_FORMAT_TIME:
|
case GST_FORMAT_TIME:
|
||||||
@ -581,6 +591,8 @@ gst_vorbisfile_src_event (GstPad *pad, GstEvent *event)
|
|||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_event_unref (event);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user