summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2011-09-15 15:07:02 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2011-09-15 15:07:02 +0300
commit33045f759f0cb124cb8eb15ac317d5340644481e (patch)
tree0a2fa5e42a7e507a03e5c6dbe1cf5c72e099cb21
parent94854aaccd747984e7b6a8414fd253eb23573b8b (diff)
downloadxine-lib-33045f759f0cb124cb8eb15ac317d5340644481e.tar.gz
xine-lib-33045f759f0cb124cb8eb15ac317d5340644481e.tar.bz2
ffmpeg audio: make sure context is allocated only once
imported patch 10115.diff
-rw-r--r--src/combined/ffmpeg/ff_audio_decoder.c4
1 files 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;
}