aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-11 23:58:36 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 00:18:02 +0200
commit835b0c44cdcc98c6b4eda2d1795797f364b2dc56 (patch)
tree06e5b893e43a79c6e82bc77eb56ae1e05f0b8b4e /src/decoder
parent54b6f8a4ae90ef1603b817902c12650eeb8328c6 (diff)
downloadmpd-835b0c44cdcc98c6b4eda2d1795797f364b2dc56.tar.gz
mpd-835b0c44cdcc98c6b4eda2d1795797f364b2dc56.tar.xz
mpd-835b0c44cdcc98c6b4eda2d1795797f364b2dc56.zip
decoder/faad: use adts_check_frame() in faad_song_duration()
Eliminate more duplicate code.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/FaadDecoderPlugin.cxx3
1 files changed, 1 insertions, 2 deletions
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())