From ed9faa202c581d92d633507591c848859fe6ea27 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 24 Jul 2019 18:47:10 +0000 Subject: mpeg: improved mp3 determination (#1008) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9012 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/mpeg/decodermpegfactory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/Input/mpeg') diff --git a/src/plugins/Input/mpeg/decodermpegfactory.cpp b/src/plugins/Input/mpeg/decodermpegfactory.cpp index 0ca79374d..8d21e7bc3 100644 --- a/src/plugins/Input/mpeg/decodermpegfactory.cpp +++ b/src/plugins/Input/mpeg/decodermpegfactory.cpp @@ -119,10 +119,12 @@ bool DecoderMPEGFactory::canDecode(QIODevice *input) const { struct mad_stream stream; struct mad_header header; + struct mad_frame frame; int dec_res; mad_stream_init(&stream); mad_header_init(&header); + mad_frame_init(&frame); mad_stream_buffer (&stream, (unsigned char *) buf, dataSize); stream.error = MAD_ERROR_NONE; @@ -131,8 +133,10 @@ bool DecoderMPEGFactory::canDecode(QIODevice *input) const ; if(dec_res == 0) - dec_res = mad_header_decode(&header, &stream); + dec_res = mad_frame_decode(&frame, &stream); + mad_stream_finish(&stream); + mad_frame_finish(&frame); return dec_res == 0; } #endif -- cgit v1.2.3-13-gbd6f