mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
riff-media: Don't divide block align by zero channels
https://bugzilla.gnome.org/show_bug.cgi?id=777525
This commit is contained in:
parent
d894c19db6
commit
5d505d1088
1 changed files with 20 additions and 14 deletions
|
@ -1299,6 +1299,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
|
|||
if (strf != NULL) {
|
||||
gint ba = strf->blockalign;
|
||||
gint ch = strf->channels;
|
||||
|
||||
if (ba > 0 && ch > 0 && (ba == (64 / 8) * ch || ba == (32 / 8) * ch)) {
|
||||
gint wd = ba * 8 / ch;
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw",
|
||||
|
@ -1315,6 +1317,10 @@ gst_riff_create_audio_caps (guint16 codec_id,
|
|||
GST_DEBUG ("using default channel layout for %d channels", ch);
|
||||
else
|
||||
GST_WARNING ("failed to add channel layout");
|
||||
} else {
|
||||
GST_WARNING ("invalid block align %d or channel count %d", ba, ch);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
/* FIXME: this is pretty useless - we need fixed caps */
|
||||
caps = gst_caps_from_string ("audio/x-raw, "
|
||||
|
|
Loading…
Reference in a new issue