From 886ea051e76a69c53ccd5ec1f9625e0a81808092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Fri, 3 Dec 2010 18:08:58 +0200 Subject: [PATCH] typefind: fix E-AC-3 frame size parsing Frame size is given in words; it is already multiplied by two where needed, so the left shift is superfluous. This extra multiplication caused the code to inspect the third packet instead of the second, which would fail for files where the second packet has a size different from the first. --- gst/typefind/gsttypefindfunctions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 030f7afdd5..de843bf0b8 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -1295,8 +1295,7 @@ ac3_type_find (GstTypeFind * tf, gpointer unused) DataScanCtx c_next = c; guint frame_size; - frame_size = ((((c.data[2] & 0x07) << 8) + - (c.data[3] & 0xff)) + 1) << 1; + frame_size = (((c.data[2] & 0x07) << 8) + (c.data[3] & 0xff)) + 1; GST_LOG ("possible E-AC3 frame sync at offset %" G_GUINT64_FORMAT ", size=%u", c.offset, frame_size); if (data_scan_ctx_ensure_data (tf, &c_next, (frame_size * 2) + 5)) {