summaryrefslogtreecommitdiffstats
path: root/ext/musepack/gstmusepackdec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/musepack/gstmusepackdec.cpp')
-rw-r--r--ext/musepack/gstmusepackdec.cpp7
1 files changed, 4 insertions, 3 deletions
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,