decoder/faad: use adts_check_frame() in faad_song_duration()

Eliminate more duplicate code.
This commit is contained in:
Max Kellermann 2014-07-11 23:58:36 +02:00
parent 54b6f8a4ae
commit 835b0c44cd

View File

@ -186,8 +186,7 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
return -1; return -1;
} }
if (length >= 2 && if (length >= 8 && adts_check_frame(data) > 0) {
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
/* obtain the duration from the ADTS header */ /* obtain the duration from the ADTS header */
if (!is.IsSeekable()) if (!is.IsSeekable())