changeset 26661:d22e246ab209

Distinguish between ac3 and dts by format tag.
author ulion
date Thu, 08 May 2008 15:55:21 +0000
parents ab5729095d68
children 1f2553fb3cbe
files libmpcodecs/ad_hwac3.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;