summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2005-02-20 12:49:19 +0000
committerTim-Philipp Müller <tim@centricular.net>2005-02-20 12:49:19 +0000
commita1a8dab8913d5e3640ec3ed736c8d307c1e92e14 (patch)
treee69a77bc378b90cc051e75e658b0f6e23574fb59 /gst-libs/gst
parent823aa669a75ee39aef399b88b26e5270276c3ee0 (diff)
downloadgst-plugins-bad-a1a8dab8913d5e3640ec3ed736c8d307c1e92e14.tar.gz
gst-plugins-bad-a1a8dab8913d5e3640ec3ed736c8d307c1e92e14.tar.bz2
gst-plugins-bad-a1a8dab8913d5e3640ec3ed736c8d307c1e92e14.zip
gst-libs/gst/riff/riff-media.c: Do actually fix invalid RIFF fmt header values for alaw and mulaw audio instead of ju...
Original commit message from CVS: * gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps_with_data): Do actually fix invalid RIFF fmt header values for alaw and mulaw audio instead of just saying so. * gst/wavparse/gstwavparse.c: (gst_wavparse_fmt): Give gst_riff_create_audio_caps_with_data() a chance to fix up broken format header fields before extracting any parameters from the header. (fixes #167633)
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/riff/riff-media.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index b93ff869..2d3ac28e 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -458,6 +458,15 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
if (strf != NULL && strf->size != 8) {
GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.",
strf->size);
+ strf->size = 8;
+ strf->av_bps = 8;
+ strf->blockalign = strf->av_bps * strf->channels;
+ }
+ if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
+ GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio",
+ strf->av_bps, strf->blockalign);
+ strf->av_bps = strf->size;
+ strf->blockalign = strf->av_bps * strf->channels;
}
caps = gst_caps_new_simple ("audio/x-mulaw", NULL);
if (codec_name)
@@ -468,6 +477,15 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
if (strf != NULL && strf->size != 8) {
GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.",
strf->size);
+ strf->size = 8;
+ strf->av_bps = 8;
+ strf->blockalign = strf->av_bps * strf->channels;
+ }
+ if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
+ GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio",
+ strf->av_bps, strf->blockalign);
+ strf->av_bps = strf->size;
+ strf->blockalign = strf->av_bps * strf->channels;
}
caps = gst_caps_new_simple ("audio/x-alaw", NULL);
if (codec_name)