Commit 80d1fbac authored by Edward Hervey's avatar Edward Hervey

gst-libs/gst/riff/riff-media.c: Yet another fix for broken software that...

gst-libs/gst/riff/riff-media.c: Yet another fix for broken software that produce files with an empty blockalign field...

Original commit message from CVS:
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
Yet another fix for broken software that produce files with an empty
blockalign field. Instead of completely failing, make a second attempt
at guessing the width/depth by looking at strf->size.
parent aa47d077
2007-12-17 Edward Hervey <edward.hervey@collabora.co.uk>
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_audio_caps):
Yet another fix for broken software that produce files with an empty
blockalign field. Instead of completely failing, make a second attempt
at guessing the width/depth by looking at strf->size.
2007-12-16 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/cdda/gstcddabasesrc.c: (gst_cdda_base_src_do_seek),
......@@ -859,14 +859,21 @@ gst_riff_create_audio_caps (guint16 codec_id,
if (strf != NULL) {
gint ba = strf->blockalign;
gint ch = strf->channels;
gint wd = ba * 8 / ch;
gint ws;
gint wd, ws;
/* If we have an empty blockalign, we take the width contained in
* strf->size */
if (ba != 0)
wd = ba * 8 / ch;
else
wd = strf->size;
if (strf->size > 32) {
GST_WARNING ("invalid depth (%d) of pcm audio, overwriting.",
strf->size);
strf->size = 8 * ((wd + 7) / 8);
}
/* in riff, the depth is stored in the size field but it just means that
* the _least_ significant bits are cleared. We can therefore just play
* the sample as if it had a depth == width */
......
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