summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-06-05 16:58:50 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-06-05 17:24:31 +0100
commit14d14a9143c9313fceb89459a90f36449b8088a4 (patch)
tree0eb97442239914c9fc35c23f7a0ea7a8352baade
parent13f6829497eceb9077c30858a50df7815ff9c16d (diff)
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.
-rw-r--r--gst/typefind/gsttypefindfunctions.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index d103dc6b9..244815c81 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");
}
}
}