From: <do...@fr...> - 2005-11-20 16:43:50
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: dolphy Date: Sun Nov 20 2005 08:43:44 PST Log message: 2005-11-20 Julien MOUTTE <ju...@mo...> * 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. Modified files: . : ChangeLog gst/matroska : matroska-mux.c gst/wavenc : gstwavenc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.1973&r2=1.1974 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/matroska/matroska-mux.c.diff?r1=1.28&r2=1.29 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/wavenc/gstwavenc.c.diff?r1=1.47&r2=1.48 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.1973 retrieving revision 1.1974 diff -u -d -r1.1973 -r1.1974 --- ChangeLog 18 Nov 2005 18:19:21 -0000 1.1973 +++ ChangeLog 20 Nov 2005 16:43:30 -0000 1.1974 @@ -1,3 +1,11 @@ +2005-11-20 Julien MOUTTE <ju...@mo...> + + * 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 <ed...@fl...> * ext/libpng/gstpngenc.c: (gst_pngenc_class_init), Index: matroska-mux.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-mux.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- matroska-mux.c 10 Nov 2005 12:22:30 -0000 1.28 +++ matroska-mux.c 20 Nov 2005 16:43:31 -0000 1.29 @@ -1087,8 +1087,7 @@ 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); Index: gstwavenc.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/wavenc/gstwavenc.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- gstwavenc.c 14 Nov 2005 02:13:34 -0000 1.47 +++ gstwavenc.c 20 Nov 2005 16:43:32 -0000 1.48 @@ -662,22 +662,30 @@ 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); + if (wavenc->flush_header) { + GstBuffer *outbuf; - gst_pad_push (wavenc->srcpad, outbuf); - wavenc->flush_header = FALSE; + 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); + GST_WARNING_OBJECT (wavenc, "failed when pushing header buffer"); + } + wavenc->flush_header = FALSE; + wavenc->length += GST_BUFFER_SIZE (buf); + result = gst_pad_push (wavenc->srcpad, buf); beach: gst_object_unref (wavenc); return result; |