Commit 68c90a2c authored by stefano's avatar stefano

Make try_decode_frame() use the new avcodec_decode_* API.

Patch by Thilo Borgmann thilo.borgmann AT g00glemail dot com.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18408 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 17a03f70
...@@ -1841,7 +1841,7 @@ static int has_codec_parameters(AVCodecContext *enc) ...@@ -1841,7 +1841,7 @@ static int has_codec_parameters(AVCodecContext *enc)
return enc->codec_id != CODEC_ID_NONE && val != 0; 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; int16_t *samples;
AVCodec *codec; AVCodec *codec;
...@@ -1860,16 +1860,16 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size) ...@@ -1860,16 +1860,16 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
if(!has_codec_parameters(st->codec)){ if(!has_codec_parameters(st->codec)){
switch(st->codec->codec_type) { switch(st->codec->codec_type) {
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
ret = avcodec_decode_video(st->codec, &picture, ret = avcodec_decode_video2(st->codec, &picture,
&got_picture, data, size); &got_picture, avpkt);
break; break;
case CODEC_TYPE_AUDIO: 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); samples = av_malloc(data_size);
if (!samples) if (!samples)
goto fail; goto fail;
ret = avcodec_decode_audio2(st->codec, samples, ret = avcodec_decode_audio3(st->codec, samples,
&data_size, data, size); &data_size, avpkt);
av_free(samples); av_free(samples);
break; break;
default: default:
...@@ -2144,7 +2144,7 @@ int av_find_stream_info(AVFormatContext *ic) ...@@ -2144,7 +2144,7 @@ int av_find_stream_info(AVFormatContext *ic)
st->codec->codec_id == CODEC_ID_PPM || st->codec->codec_id == CODEC_ID_PPM ||
st->codec->codec_id == CODEC_ID_SHORTEN || st->codec->codec_id == CODEC_ID_SHORTEN ||
(st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/) (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
try_decode_frame(st, pkt->data, pkt->size); try_decode_frame(st, pkt);
count++; count++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment