Commit 985daa9d authored by Julien Moutte Moutte's avatar Julien Moutte Moutte
Browse files

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.
parent 978a8d15
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),
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment