ext/musepack/gstmusepackdec.cpp: Fetch error return values. Fixes #161624.

Original commit message from CVS:
* ext/musepack/gstmusepackdec.cpp:
Fetch error return values. Fixes #161624.
* gst/apetag/apedemux.c: (gst_ape_demux_stream_data):
Really EOS.
This commit is contained in:
Ronald S. Bultje 2004-12-18 21:56:46 +00:00
parent dc2a11875b
commit 9663158bfa
4 changed files with 20 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/musepack/gstmusepackdec.cpp:
Fetch error return values. Fixes #161624.
* gst/apetag/apedemux.c: (gst_ape_demux_stream_data):
Really EOS.
2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/avi/gstavidemux.c: (gst_avi_demux_stream_index):

View file

@ -416,6 +416,7 @@ gst_musepackdec_loop (GstElement * element)
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (element);
GstBuffer *out;
GstFormat fmt;
gint ret;
if (!musepackdec->dec) {
if (!gst_musepack_stream_init (musepackdec))
@ -444,9 +445,8 @@ gst_musepackdec_loop (GstElement * element)
}
out = gst_buffer_new_and_alloc (MPC_decoder::DecodeBufferLength * 4);
GST_BUFFER_SIZE (out) =
musepackdec->dec->Decode ((MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out));
if (GST_BUFFER_SIZE (out) == 0) {
ret = musepackdec->dec->Decode ((MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out));
if (ret <= 0) {
if (musepackdec->reader->eos == true) {
gst_element_set_eos (element);
gst_pad_push (musepackdec->srcpad,
@ -455,6 +455,7 @@ gst_musepackdec_loop (GstElement * element)
gst_buffer_unref (out);
return;
}
GST_BUFFER_SIZE (out) = ret;
/* note that the size is still in samples */
fmt = GST_FORMAT_TIME;
gst_pad_query (musepackdec->srcpad,

View file

@ -416,6 +416,7 @@ gst_musepackdec_loop (GstElement * element)
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (element);
GstBuffer *out;
GstFormat fmt;
gint ret;
if (!musepackdec->dec) {
if (!gst_musepack_stream_init (musepackdec))
@ -444,9 +445,8 @@ gst_musepackdec_loop (GstElement * element)
}
out = gst_buffer_new_and_alloc (MPC_decoder::DecodeBufferLength * 4);
GST_BUFFER_SIZE (out) =
musepackdec->dec->Decode ((MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out));
if (GST_BUFFER_SIZE (out) == 0) {
ret = musepackdec->dec->Decode ((MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out));
if (ret <= 0) {
if (musepackdec->reader->eos == true) {
gst_element_set_eos (element);
gst_pad_push (musepackdec->srcpad,
@ -455,6 +455,7 @@ gst_musepackdec_loop (GstElement * element)
gst_buffer_unref (out);
return;
}
GST_BUFFER_SIZE (out) = ret;
/* note that the size is still in samples */
fmt = GST_FORMAT_TIME;
gst_pad_query (musepackdec->srcpad,

View file

@ -721,12 +721,17 @@ gst_ape_demux_stream_data (GstApeDemux * ape)
new = gst_event_new_discontinuous (GST_EVENT_DISCONT_NEW_MEDIA (event),
GST_FORMAT_BYTES, new_off, GST_FORMAT_UNDEFINED);
gst_event_unref (event);
event = new;
data = GST_DATA (new);
break;
}
default:
break;
}
gst_pad_event_default (ape->sinkpad, event);
return;
} else {
GstBuffer *buf = GST_BUFFER (data), *kid;
gint64 pos, len;