diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-12-18 21:56:46 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-12-18 21:56:46 +0000 |
commit | 9663158bfa78107c2404d8c7fd389641397e6e33 (patch) | |
tree | 87d0bd7dabe6fc48a8262aebf4660b75f0d097e3 | |
parent | dc2a11875ba6ae0c12ac5649839e314ba87feb13 (diff) | |
download | gst-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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/musepack/gstmusepackdec.c | 7 | ||||
-rw-r--r-- | ext/musepack/gstmusepackdec.cpp | 7 | ||||
-rw-r--r-- | gst/apetag/apedemux.c | 5 |
4 files changed, 20 insertions, 6 deletions
@@ -1,5 +1,12 @@ 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): Work for truncated (unfinished download etc.) files. Fixes #160514. 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, diff --git a/gst/apetag/apedemux.c b/gst/apetag/apedemux.c index 0c232261..8830cae3 100644 --- a/gst/apetag/apedemux.c +++ b/gst/apetag/apedemux.c @@ -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; |