diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-02-09 20:54:22 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-02-09 20:54:22 +0000 |
| commit | 3f7a4110979a94f326a77ea20d3817f9623fd2f5 (patch) | |
| tree | 3f8a60a1d051145c28fce1062476e13f1275bffb | |
| parent | 2353380439e8ec0239791a6602884cb8363a1ae9 (diff) | |
| download | qmmp-3f7a4110979a94f326a77ea20d3817f9623fd2f5.tar.gz qmmp-3f7a4110979a94f326a77ea20d3817f9623fd2f5.tar.bz2 qmmp-3f7a4110979a94f326a77ea20d3817f9623fd2f5.zip | |
mpeg: disabled CRC checking
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9718 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mad.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mad.h | 43 |
2 files changed, 25 insertions, 22 deletions
diff --git a/src/plugins/Input/mpeg/decoder_mad.cpp b/src/plugins/Input/mpeg/decoder_mad.cpp index b19389a82..073871c70 100644 --- a/src/plugins/Input/mpeg/decoder_mad.cpp +++ b/src/plugins/Input/mpeg/decoder_mad.cpp @@ -74,6 +74,7 @@ bool DecoderMAD::initialize() } mad_stream_init(&m_stream); + mad_stream_options(&m_stream, MAD_OPTION_IGNORECRC); mad_frame_init(&m_frame); mad_synth_init(&m_synth); @@ -520,6 +521,9 @@ bool DecoderMAD::decodeFrame() if(m_eof) return false; continue; + case MAD_ERROR_BADCRC: + qDebug("DecoderMAD: CRC check error"); + continue; default: if (!MAD_RECOVERABLE(m_stream.error)) return false; diff --git a/src/plugins/Input/mpeg/decoder_mad.h b/src/plugins/Input/mpeg/decoder_mad.h index d8640634c..b87ed6061 100644 --- a/src/plugins/Input/mpeg/decoder_mad.h +++ b/src/plugins/Input/mpeg/decoder_mad.h @@ -52,27 +52,6 @@ private: unsigned short end_padding; qint8 gain; }; - // helper functions - bool decodeFrame(); - qint64 madOutputFloat(float *data, qint64 samples); - bool fillBuffer(); - void deinit(); - bool findHeader(); - bool findXingHeader(struct mad_bitptr, unsigned int bitlen); - LameHeader *findLameHeader(struct mad_bitptr ptr, unsigned int bitlen); - uint findID3v2(uchar *data, ulong size); - - bool m_inited = false, m_eof = false; - qint64 m_totalTime = 0; - int m_channels = 0, m_skip_frames = 0; - uint m_bitrate = 0; - long m_freq = 0, m_len = 0; - - // file input buffer - char *m_input_buf = nullptr; - qint64 m_input_bytes = 0; - - // MAD decoder //xing header struct XingHeader @@ -94,11 +73,31 @@ private: XING_SCALE = 0x0008 }; + // helper functions + bool decodeFrame(); + qint64 madOutputFloat(float *data, qint64 samples); + bool fillBuffer(); + void deinit(); + bool findHeader(); + bool findXingHeader(struct mad_bitptr, unsigned int bitlen); + LameHeader *findLameHeader(struct mad_bitptr ptr, unsigned int bitlen); + uint findID3v2(uchar *data, ulong size); + + bool m_inited = false, m_eof = false; + qint64 m_totalTime = 0; + int m_channels = 0, m_skip_frames = 0; + uint m_bitrate = 0; + long m_freq = 0, m_len = 0; + + // file input buffer + char *m_input_buf = nullptr; + qint64 m_input_bytes = 0; + + // MAD decoder struct mad_stream m_stream; struct mad_frame m_frame; struct mad_synth m_synth; qint64 m_skip_bytes = 0, m_play_bytes = -1; - }; |
