+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):
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (element);
GstBuffer *out;
GstFormat fmt;
+ gint ret;
if (!musepackdec->dec) {
if (!gst_musepack_stream_init (musepackdec))
}
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,
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,
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (element);
GstBuffer *out;
GstFormat fmt;
+ gint ret;
if (!musepackdec->dec) {
if (!gst_musepack_stream_init (musepackdec))
}
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,
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,
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;