# HG changeset patch # User ulion # Date 1210262121 0 # Node ID d22e246ab2091eb5c45c3e5c1cf09eb6826e4301 # Parent ab5729095d68bf9dd45e1291685c92812f225ad0 Distinguish between ac3 and dts by format tag. diff -r ab5729095d68 -r d22e246ab209 libmpcodecs/ad_hwac3.c --- a/libmpcodecs/ad_hwac3.c Thu May 08 13:54:00 2008 +0000 +++ b/libmpcodecs/ad_hwac3.c Thu May 08 15:55:21 2008 +0000 @@ -61,6 +61,8 @@ sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++] = c; } + if (sh_audio->format == 0x2001) + { length = dts_syncinfo(sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); if(length >= 12) { @@ -71,6 +73,9 @@ } break; } + } + else + { length = a52_syncinfo(sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); if(length >= 7 && length <= 3840) { @@ -81,6 +86,7 @@ } break; /* we're done.*/ } + } /* bad file => resync*/ memcpy(sh_audio->a_in_buffer, sh_audio->a_in_buffer + 1, 11); --sh_audio->a_in_buffer_len;