From 9663158bfa78107c2404d8c7fd389641397e6e33 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 18 Dec 2004 21:56:46 +0000 Subject: 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. --- ext/musepack/gstmusepackdec.c | 7 ++++--- ext/musepack/gstmusepackdec.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'ext') 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, -- cgit v1.2.1