diff options
author | Thilo Borgmann <thilo.borgmann@googlemail.com> | 2009-04-10 11:03:06 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-04-10 11:03:06 +0000 |
commit | 655d47c2cb5134d6aeb31d829f5abf455d0d7e2f (patch) | |
tree | 60a177e0506cd452b191c90c2431bcb7910fd5cb | |
parent | b6b66760858630cf4719bed365f213a572ee9a63 (diff) | |
download | ffmpeg-655d47c2cb5134d6aeb31d829f5abf455d0d7e2f.tar.gz |
Make try_decode_frame() use the new avcodec_decode_* API.
Patch by Thilo Borgmann thilo.borgmann AT g00glemail dot com.
Originally committed as revision 18408 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d3b9c090eb..d209fe712f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1841,7 +1841,7 @@ static int has_codec_parameters(AVCodecContext *enc) return enc->codec_id != CODEC_ID_NONE && val != 0; } -static int try_decode_frame(AVStream *st, const uint8_t *data, int size) +static int try_decode_frame(AVStream *st, AVPacket *avpkt) { int16_t *samples; AVCodec *codec; @@ -1860,16 +1860,16 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size) if(!has_codec_parameters(st->codec)){ switch(st->codec->codec_type) { case CODEC_TYPE_VIDEO: - ret = avcodec_decode_video(st->codec, &picture, - &got_picture, data, size); + ret = avcodec_decode_video2(st->codec, &picture, + &got_picture, avpkt); break; case CODEC_TYPE_AUDIO: - data_size = FFMAX(size, AVCODEC_MAX_AUDIO_FRAME_SIZE); + data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE); samples = av_malloc(data_size); if (!samples) goto fail; - ret = avcodec_decode_audio2(st->codec, samples, - &data_size, data, size); + ret = avcodec_decode_audio3(st->codec, samples, + &data_size, avpkt); av_free(samples); break; default: @@ -2144,7 +2144,7 @@ int av_find_stream_info(AVFormatContext *ic) st->codec->codec_id == CODEC_ID_PPM || st->codec->codec_id == CODEC_ID_SHORTEN || (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/) - try_decode_frame(st, pkt->data, pkt->size); + try_decode_frame(st, pkt); count++; } |