summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-04-23 00:47:41 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-04-23 00:47:41 +0000
commit0afe517495434a49c8681e69587bf8baaac5d53d (patch)
treec8ee93dc2de5017c171fbc446ce53754f76f5f83
parent65d9f3c1736ad81add8a7584de7e61d98a61b6ea (diff)
gst/wavparse/gstwavparse.c: Missing variable initialization. Add handling of DVI ADPCM. Fix mis-parsing of LIST chunk...
Original commit message from CVS: * 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.
-rw-r--r--ChangeLog12
-rw-r--r--gst/wavparse/gstwavparse.c21
2 files changed, 31 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1758ccc3..afd46b19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-22 Ronald Bultje <rbultje@ronald.bitfreak.net>
+
+ * 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 <zaheerabbas@merali.org>
reviewed by Benjamin Otte <otte@gnome.org>
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index b7780207..dc34eed9 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -84,6 +84,11 @@ static GstStaticPadTemplate src_template_factory =
"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 @@ gst_wavparse_create_sourcepad (GstWavParse * wavparse)
(&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 @@ gst_wavparse_parse_fmt (GstWavParse * wavparse, guint size)
"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 @@ gst_wavparse_handle_sink_event (GstWavParse * wavparse)
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 @@ gst_wavparse_loop (GstElement * element)
chunk.type = GUINT32_FROM_LE (temp_chunk->type);
skipsize = sizeof (gst_riff_list);
+ chunk.size -= 4; /* size is including list type, which we flush */
break;
case GST_RIFF_TAG_cue:
@@ -901,6 +917,7 @@ gst_wavparse_loop (GstElement * element)
//flush = 0;
break;
}
+ break;
default:
GST_DEBUG (" ***** unknown chunkid %08x", chunk.id);