codec-utils: accept wrong version field in OpusHead header

Some Opus files found on the wild have 0 in the version field of the
OpusHead header, instead of the correct value of 1. The files still
play, don't make this error fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=758754
This commit is contained in:
Luis de Bethencourt 2015-11-28 14:24:55 +00:00
parent aae0dc37c9
commit 2a70c86e85

View file

@ -1519,7 +1519,7 @@ gst_codec_utils_opus_parse_header (GstBuffer * header,
GstByteReader br; GstByteReader br;
GstMapInfo map; GstMapInfo map;
gboolean ret = TRUE; gboolean ret = TRUE;
guint8 c, f; guint8 c, f, version;
g_return_val_if_fail (GST_IS_BUFFER (header), FALSE); g_return_val_if_fail (GST_IS_BUFFER (header), FALSE);
g_return_val_if_fail (gst_buffer_get_size (header) >= 19, FALSE); g_return_val_if_fail (gst_buffer_get_size (header) >= 19, FALSE);
@ -1532,7 +1532,10 @@ gst_codec_utils_opus_parse_header (GstBuffer * header,
ret = FALSE; ret = FALSE;
goto done; goto done;
} }
if (gst_byte_reader_get_uint8_unchecked (&br) != 0x01) { version = gst_byte_reader_get_uint8_unchecked (&br);
if (version == 0x00)
GST_ERROR ("Opus Header version is wrong, should be 0x01 and not 0x00");
else if (version != 0x01) {
ret = FALSE; ret = FALSE;
goto done; goto done;
} }