diff options
author | Julien Moutte <julien@moutte.net> | 2005-11-20 16:43:32 +0000 |
---|---|---|
committer | Julien Moutte <julien@moutte.net> | 2005-11-20 16:43:32 +0000 |
commit | 985daa9d64adeace2b3dea9e319427e2154f125e (patch) | |
tree | 2dbd2090efe92e188f229a19a8139bb15f6354e7 | |
parent | 978a8d1529e53fe3926bccccb05310a25e5204d5 (diff) |
gst/matroska/matroska-mux.c: Fix for
Original commit message from CVS:
2005-11-20 Julien MOUTTE <julien@moutte.net>
* gst/matroska/matroska-mux.c: (gst_matroska_mux_start): Fix for
API changes.
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix for API
changes,
but also fix the code that was not checking return values from
pad_push neither using pad_alloc_buffer.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/matroska/matroska-mux.c | 3 | ||||
-rw-r--r-- | gst/wavenc/gstwavenc.c | 32 |
3 files changed, 29 insertions, 14 deletions
@@ -1,3 +1,11 @@ +2005-11-20 Julien MOUTTE <julien@moutte.net> + + * gst/matroska/matroska-mux.c: (gst_matroska_mux_start): Fix for + API changes. + * gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix for API changes, + but also fix the code that was not checking return values from + pad_push neither using pad_alloc_buffer. + 2005-11-18 Edward Hervey <edward@fluendo.com> * ext/libpng/gstpngenc.c: (gst_pngenc_class_init), diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 84d59a96..bba6ee23 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -1087,8 +1087,7 @@ gst_matroska_mux_start (GstMatroskaMux * mux) collect_pad = (GstMatroskaPad *) collected->data; thepad = collect_pad->collect.pad; - if (GST_PAD_IS_USABLE (thepad) - && collect_pad->track->codec_id != 0) { + if (collect_pad->track->codec_id != 0) { collect_pad->track->num = tracknum++; child = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_TRACKENTRY); gst_matroska_mux_track_header (mux, collect_pad->track); diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c index 435db53c..a964896e 100644 --- a/gst/wavenc/gstwavenc.c +++ b/gst/wavenc/gstwavenc.c @@ -662,22 +662,30 @@ gst_wavenc_chain (GstPad * pad, GstBuffer * buf) goto beach; } - if (GST_PAD_IS_USABLE (wavenc->srcpad)) { - if (wavenc->flush_header) { - GstBuffer *outbuf; - - outbuf = gst_buffer_new_and_alloc (WAV_HEADER_LEN); - memcpy (GST_BUFFER_DATA (outbuf), wavenc->header, WAV_HEADER_LEN); - GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); - - gst_pad_push (wavenc->srcpad, outbuf); - wavenc->flush_header = FALSE; + if (wavenc->flush_header) { + GstBuffer *outbuf; + + result = gst_pad_alloc_buffer (wavenc->srcpad, GST_BUFFER_OFFSET_NONE, + WAV_HEADER_LEN, GST_PAD_CAPS (wavenc->srcpad), &outbuf); + if (result != GST_FLOW_OK) { + GST_WARNING_OBJECT (wavenc, "failed when allocating a %d bytes buffer " + "for headers", WAV_HEADER_LEN); + goto beach; } + memcpy (GST_BUFFER_DATA (outbuf), wavenc->header, WAV_HEADER_LEN); + GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); - wavenc->length += GST_BUFFER_SIZE (buf); - gst_pad_push (wavenc->srcpad, buf); + result = gst_pad_push (wavenc->srcpad, outbuf); + if (result != GST_FLOW_OK) { + GST_WARNING_OBJECT (wavenc, "failed when pushing header buffer"); + goto beach; + } + wavenc->flush_header = FALSE; } + wavenc->length += GST_BUFFER_SIZE (buf); + result = gst_pad_push (wavenc->srcpad, buf); + beach: gst_object_unref (wavenc); return result; |