diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-10-23 02:47:18 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-10-23 02:47:18 +0000 |
commit | dcdfd0d3e5956b5f18359ef50006489a7caa10c4 (patch) | |
tree | 86124d8b2096aba85bbdf8b86c430677137effcb /src/libffmpeg/audio_decoder.c | |
parent | 2049c84023235f1bec25282afd353433bb8ead39 (diff) | |
download | xine-lib-dcdfd0d3e5956b5f18359ef50006489a7caa10c4.tar.gz xine-lib-dcdfd0d3e5956b5f18359ef50006489a7caa10c4.tar.bz2 |
some fixes - qdm2 not yet working...
time to sleep
CVS patchset: 7769
CVS date: 2005/10/23 02:47:18
Diffstat (limited to 'src/libffmpeg/audio_decoder.c')
-rw-r--r-- | src/libffmpeg/audio_decoder.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/libffmpeg/audio_decoder.c b/src/libffmpeg/audio_decoder.c index 18cf3ff9e..ed1a52a5d 100644 --- a/src/libffmpeg/audio_decoder.c +++ b/src/libffmpeg/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.18 2005/10/23 02:11:16 miguelfreitas Exp $ + * $Id: audio_decoder.c,v 1.19 2005/10/23 02:47:18 miguelfreitas Exp $ * * xine audio decoder plugin using ffmpeg * @@ -226,27 +226,29 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->decode_buffer = xine_xmalloc(AVCODEC_MAX_AUDIO_FRAME_SIZE); - if (avcodec_open (this->context, this->codec) < 0) { - xprintf (this->stream->xine, XINE_VERBOSITY_LOG, - _("ffmpeg_audio_dec: couldn't open decoder\n")); - _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); - return; - } - - this->decoder_ok = 1; - return; } } else if ((buf->decoder_flags & BUF_FLAG_SPECIAL) && (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM)) { - + this->context->extradata_size = buf->decoder_info[2]; this->context->extradata = xine_xmalloc(buf->decoder_info[2] + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(this->context->extradata, buf->decoder_info_ptr[2], buf->decoder_info[2]); - } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) { + } else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) { + + if( !this->decoder_ok ) { + if (avcodec_open (this->context, this->codec) < 0) { + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, + _("ffmpeg_audio_dec: couldn't open decoder\n")); + _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0); + return; + } + + this->decoder_ok = 1; + } if (!this->output_open) { this->output_open = this->stream->audio_out->open(this->stream->audio_out, |