From e4c894bb4df1ab7224111557ebaec4905c85212c Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 22 Feb 2010 21:41:21 +0000 Subject: 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 --- src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 9 ++++----- 1 file 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 #include - +#include #include #include #include @@ -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"); -- cgit v1.2.3-13-gbd6f