From 14d14a9143c9313fceb89459a90f36449b8088a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 5 Jun 2010 16:58:50 +0100 Subject: [PATCH] typefinding: fix AC-3 typefinding so that it actually checks for a second frame Fix typo that made the AC-3 typefinder not actually check for a second frame, but rather compare the sync point found to itself, which resulted in the AC-3 typefinder reporting an overly optimistic MAXIMUM or VERY_LIKELY probability when it found a possible frame sync. --- gst/typefind/gsttypefindfunctions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index d103dc6..244815c 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -1217,8 +1217,10 @@ ac3_type_find (GstTypeFind * tf, gpointer unused) guint frame_size; frame_size = ac3_frmsizecod_tbl[frmsizecod].frm_size[fscod]; + GST_LOG ("possible 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)) { - data_scan_ctx_advance (tf, &c, frame_size * 2); + data_scan_ctx_advance (tf, &c_next, frame_size * 2); if (c_next.data[0] == 0x0b && c_next.data[1] == 0x77) { guint fscod2 = (c_next.data[4] >> 6) & 0x03; @@ -1227,6 +1229,7 @@ ac3_type_find (GstTypeFind * tf, gpointer unused) if (fscod == fscod2 && frmsizecod == frmsizecod2) { GstTypeFindProbability prob; + GST_LOG ("found second frame, looks good"); if (c.offset == 0) prob = GST_TYPE_FIND_MAXIMUM; else @@ -1235,6 +1238,8 @@ ac3_type_find (GstTypeFind * tf, gpointer unused) gst_type_find_suggest (tf, prob, AC3_CAPS); return; } + } else { + GST_LOG ("no second frame found, false sync"); } } } -- 2.7.4