1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 04:45:33 +00:00

Distinguish between ac3 and dts by format tag.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26693 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ulion 2008-05-08 15:55:21 +00:00
parent 2c9139be84
commit 30f7fb8c69

View File

@ -61,6 +61,8 @@ static int ac3dts_fillbuff(sh_audio_t *sh_audio)
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 @@ static int ac3dts_fillbuff(sh_audio_t *sh_audio)
}
break;
}
}
else
{
length = a52_syncinfo(sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate);
if(length >= 7 && length <= 3840)
{
@ -81,6 +86,7 @@ static int ac3dts_fillbuff(sh_audio_t *sh_audio)
}
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;