From: Ronald S. B. <rb...@pd...> - 2004-04-23 00:47:56
|
CVS Root: /home/cvs/gstreamer Module: gst-plugins Changes by: rbultje Date: Thu Apr 22 2004 17:47:54 PDT Log message: * gst/wavparse/gstwavparse.c: (gst_wavparse_create_sourcepad), (gst_wavparse_parse_fmt), (gst_wavparse_handle_sink_event), (gst_wavparse_loop): Missing variable initialization. Add handling of DVI ADPCM. Fix mis-parsing of LIST chunks. This works around a bug where we mis- parse non-aligning LIST chunks (so LIST chunks where the contents don't align with the actual LIST size). The correct fix is to use rifflib, I'm not going to fix wavparse - too much work. All this fixes #104878. Modified files: . : ChangeLog gst/wavparse : gstwavparse.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.564&r2=1.565 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/wavparse/gstwavparse.c.diff?r1=1.62&r2=1.63 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.564 retrieving revision 1.565 diff -u -d -r1.564 -r1.565 --- a/ChangeLog 22 Apr 2004 15:50:05 -0000 1.564 +++ b/ChangeLog 23 Apr 2004 00:47:41 -0000 1.565 @@ -1,3 +1,15 @@ +2004-04-22 Ronald Bultje <rb...@ro...> + + * gst/wavparse/gstwavparse.c: (gst_wavparse_create_sourcepad), + (gst_wavparse_parse_fmt), (gst_wavparse_handle_sink_event), + (gst_wavparse_loop): + Missing variable initialization. Add handling of DVI ADPCM. Fix + mis-parsing of LIST chunks. This works around a bug where we mis- + parse non-aligning LIST chunks (so LIST chunks where the contents + don't align with the actual LIST size). The correct fix is to use + rifflib, I'm not going to fix wavparse - too much work. All this + fixes #104878. 2004-04-22 Zaheer Abbas Merali <zah...@me...> reviewed by Benjamin Otte <ot...@gn...> Index: gstwavparse.c RCS file: /home/cvs/gstreamer/gst-plugins/gst/wavparse/gstwavparse.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- a/gstwavparse.c 18 Apr 2004 23:40:34 -0000 1.62 +++ b/gstwavparse.c 23 Apr 2004 00:47:41 -0000 1.63 @@ -84,6 +84,11 @@ "audio/x-adpcm, " "layout = (string) microsoft, " "block_align = (int) [ 1, 8192 ], " + "rate = (int) [ 8000, 48000 ], " + "channels = (int) [ 1, 2 ]; " + "audio/x-adpcm, " + "layout = (string) dvi, " + "block_align = (int) [ 1, 8192 ], " "rate = (int) [ 8000, 48000 ], " "channels = (int) [ 1, 2 ]") ); @@ -214,6 +219,7 @@ (&src_template_factory), "src"); gst_pad_use_explicit_caps (wavparse->srcpad); /*gst_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad); */ + /*gst_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad); */ gst_pad_set_formats_function (wavparse->srcpad, gst_wavparse_get_formats); gst_pad_set_convert_function (wavparse->srcpad, gst_wavparse_pad_convert); gst_pad_set_query_type_function (wavparse->srcpad, @@ -664,6 +670,14 @@ "channels", G_TYPE_INT, wavparse->channels, NULL); break; + case GST_RIFF_WAVE_FORMAT_DVI_ADPCM: + caps = gst_caps_new_simple ("audio/x-adpcm", + "layout", G_TYPE_STRING, "dvi", + "block_align", G_TYPE_INT, wavparse->bps, + "rate", G_TYPE_INT, wavparse->rate, + "channels", G_TYPE_INT, wavparse->channels, NULL); + break; case GST_RIFF_WAVE_FORMAT_MPEGL12: case GST_RIFF_WAVE_FORMAT_MPEGL3:{ int layer = (wavparse->format == GST_RIFF_WAVE_FORMAT_MPEGL12) ? 2 : 3; @@ -717,8 +731,9 @@ break; default: - g_warning ("Wavparse: Unhandled event %d", type); - break; + GST_WARNING ("Wavparse: Unhandled event %d", type); + gst_pad_event_default (wavparse->sinkpad, event); + goto done; } gst_event_unref (event); @@ -834,6 +849,7 @@ chunk.type = GUINT32_FROM_LE (temp_chunk->type); skipsize = sizeof (gst_riff_list); + chunk.size -= 4; /* size is including list type, which we flush */ case GST_RIFF_TAG_cue: @@ -901,6 +917,7 @@ //flush = 0; break; } + break; default: GST_DEBUG (" ***** unknown chunkid %08x", chunk.id); |