diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-02-22 21:41:21 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-02-22 21:41:21 +0000 |
| commit | e4c894bb4df1ab7224111557ebaec4905c85212c (patch) | |
| tree | d95034e278c336f00944bfc9861db139c97f0277 | |
| parent | 8a42b4e4a37d11d7542951c669d3e696724e1fb6 (diff) | |
| download | qmmp-e4c894bb4df1ab7224111557ebaec4905c85212c.tar.gz qmmp-e4c894bb4df1ab7224111557ebaec4905c85212c.tar.bz2 qmmp-e4c894bb4df1ab7224111557ebaec4905c85212c.zip | |
ffmpeg plugin: fixed crash on aac streams
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1570 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index a989a8805..bda8ff7e7 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -20,7 +20,7 @@ #include <QObject> #include <QFile> - +#include <malloc.h> #include <qmmp/buffer.h> #include <qmmp/output.h> #include <qmmp/recycler.h> @@ -92,7 +92,7 @@ DecoderFFmpeg::~DecoderFFmpeg() if(m_pkt.data) av_free_packet(&m_pkt); if(m_output_buf) - delete [] m_output_buf; + free(m_output_buf); } bool DecoderFFmpeg::initialize() @@ -163,8 +163,6 @@ bool DecoderFFmpeg::initialize() return FALSE; } - c->dsp_mask |= FF_MM_MMX; //ffmpeg bug workarround - if (avcodec_open(c, codec) < 0) { qWarning("DecoderFFmpeg: error while opening codec for output stream"); @@ -172,7 +170,8 @@ bool DecoderFFmpeg::initialize() } m_totalTime = input()->isSequential() ? 0 : ic->duration * 1000 / AV_TIME_BASE; - m_output_buf = new uint8_t[AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t) + QMMP_BUFFER_SIZE]; + m_output_buf = (uint8_t *)memalign(16, AVCODEC_MAX_AUDIO_FRAME_SIZE * 3 / 2 + QMMP_BUFFER_SIZE); + configure(c->sample_rate, c->channels, Qmmp::PCM_S16LE); m_bitrate = c->bit_rate; qDebug("DecoderFFmpeg: initialize succes"); |
