From 835b0c44cdcc98c6b4eda2d1795797f364b2dc56 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 11 Jul 2014 23:58:36 +0200 Subject: decoder/faad: use adts_check_frame() in faad_song_duration() Eliminate more duplicate code. --- src/decoder/FaadDecoderPlugin.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/decoder/FaadDecoderPlugin.cxx b/src/decoder/FaadDecoderPlugin.cxx index aa5c6835f..bc3533228 100644 --- a/src/decoder/FaadDecoderPlugin.cxx +++ b/src/decoder/FaadDecoderPlugin.cxx @@ -186,8 +186,7 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is) return -1; } - if (length >= 2 && - data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) { + if (length >= 8 && adts_check_frame(data) > 0) { /* obtain the duration from the ADTS header */ if (!is.IsSeekable()) -- cgit v1.2.3