aacparse: only require two frames in a row when we do not have sync

This avoids a single bit error dropping two frames unnecessarily.
The two consecutive frames check is still required when we don't
have sync.

https://bugzilla.gnome.org/show_bug.cgi?id=657080
This commit is contained in:
Vincent Penquerc'h 2011-08-23 12:12:15 +01:00 committed by Sebastian Dröge
parent bd604175c5
commit f3fc3e1f69

View file

@ -340,8 +340,12 @@ gst_aac_parse_check_adts_frame (GstAacParse * aacparse,
if ((data[0] == 0xff) && ((data[1] & 0xf6) == 0xf0)) {
*framesize = gst_aac_parse_adts_get_frame_len (data);
/* In EOS mode this is enough. No need to examine the data further */
if (drain) {
/* In EOS mode this is enough. No need to examine the data further.
We also relax the check when we have sync, on the assumption that
if we're not looking at random data, we have a much higher chance
to get the correct sync, and this avoids losing two frames when
a single bit corruption happens. */
if (drain || !GST_BASE_PARSE_LOST_SYNC (aacparse)) {
return TRUE;
}