summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis de Bethencourt <luisbg@osg.samsung.com>2015-11-28 14:24:55 +0000
committerLuis de Bethencourt <luisbg@osg.samsung.com>2015-12-01 15:47:35 +0000
commit2a70c86e85a8ba07726212c8eece10fd92c88693 (patch)
treee2cfba3a8fffb17c65cc440cfeb24b93b9301c4c
parentaae0dc37c934164ba876557b8d862efe596b4c26 (diff)
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
-rw-r--r--gst-libs/gst/pbutils/codec-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gst-libs/gst/pbutils/codec-utils.c b/gst-libs/gst/pbutils/codec-utils.c
index c37ca63bf..2c8c5a9b8 100644
--- a/gst-libs/gst/pbutils/codec-utils.c
+++ b/gst-libs/gst/pbutils/codec-utils.c
@@ -1519,7 +1519,7 @@ gst_codec_utils_opus_parse_header (GstBuffer * header,
GstByteReader br;
GstMapInfo map;
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_buffer_get_size (header) >= 19, FALSE);
@@ -1532,7 +1532,10 @@ gst_codec_utils_opus_parse_header (GstBuffer * header,
ret = FALSE;
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;
goto done;
}