summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-18 21:56:46 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-18 21:56:46 +0000
commit9663158bfa78107c2404d8c7fd389641397e6e33 (patch)
tree87d0bd7dabe6fc48a8262aebf4660b75f0d097e3 /ext
parentdc2a11875ba6ae0c12ac5649839e314ba87feb13 (diff)
downloadgst-plugins-bad-9663158bfa78107c2404d8c7fd389641397e6e33.tar.gz
gst-plugins-bad-9663158bfa78107c2404d8c7fd389641397e6e33.tar.bz2
gst-plugins-bad-9663158bfa78107c2404d8c7fd389641397e6e33.zip
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/musepack/gstmusepackdec.c7
-rw-r--r--ext/musepack/gstmusepackdec.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/ext/musepack/gstmusepackdec.c b/ext/musepack/gstmusepackdec.c
index a86828c2..7917a346 100644
--- a/ext/musepack/gstmusepackdec.c
+++ b/ext/musepack/gstmusepackdec.c
@@ -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,
diff --git a/ext/musepack/gstmusepackdec.cpp b/ext/musepack/gstmusepackdec.cpp
index a86828c2..7917a346 100644
--- a/ext/musepack/gstmusepackdec.cpp
+++ b/ext/musepack/gstmusepackdec.cpp
@@ -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,