From 33045f759f0cb124cb8eb15ac317d5340644481e Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 15 Sep 2011 15:07:02 +0300 Subject: ffmpeg audio: make sure context is allocated only once imported patch 10115.diff --- src/combined/ffmpeg/ff_audio_decoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index 269342ddb..34ccadeee 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -178,8 +178,6 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) return; } - this->context = avcodec_alloc_context(); - if(buf->decoder_flags & BUF_FLAG_STDHEADER) { this->audio_sample_rate = buf->decoder_info[1]; this->audio_channels = buf->decoder_info[3]; @@ -536,6 +534,8 @@ static audio_decoder_t *ff_audio_open_plugin (audio_decoder_class_t *class_gen, ff_audio_ensure_buffer_size(this, AUDIOBUFSIZE); + this->context = avcodec_alloc_context(); + return &this->audio_decoder; } -- cgit v1.2.3