History

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

Thilo Borgmann committed 17 years ago

Commit 655d47c1 parent b6b66761 file · +7 −7Browse files

Unified · Split

libavformat/utils.c+7−7
@@ -1841,7 +1841,7 @@ static int has_codec_parameters(AVCodecContext *enc) · 1840 unmodified lines
18411841 return enc->codec_id != CODEC_ID_NONE && val != 0;
18421842 }
18431843
1844−static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
1844+static int try_decode_frame(AVStream *st, AVPacket *avpkt)
18451845 {
18461846 int16_t *samples;
18471847 AVCodec *codec;
@@ -1860,16 +1860,16 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size) · 12 unmodified lines
18601860 if(!has_codec_parameters(st->codec)){
18611861 switch(st->codec->codec_type) {
18621862 case CODEC_TYPE_VIDEO:
1863− ret = avcodec_decode_video(st->codec, &picture,
1864− &got_picture, data, size);
1863+ ret = avcodec_decode_video2(st->codec, &picture,
1864+ &got_picture, avpkt);
18651865 break;
18661866 case CODEC_TYPE_AUDIO:
1867− data_size = FFMAX(size, AVCODEC_MAX_AUDIO_FRAME_SIZE);
1867+ data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE);
18681868 samples = av_malloc(data_size);
18691869 if (!samples)
18701870 goto fail;
1871− ret = avcodec_decode_audio2(st->codec, samples,
1872− &data_size, data, size);
1871+ ret = avcodec_decode_audio3(st->codec, samples,
1872+ &data_size, avpkt);
18731873 av_free(samples);
18741874 break;
18751875 default:
@@ -2144,7 +2144,7 @@ int av_find_stream_info(AVFormatContext *ic) · 268 unmodified lines
21442144 st->codec->codec_id == CODEC_ID_PPM ||
21452145 st->codec->codec_id == CODEC_ID_SHORTEN ||
21462146 (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
2147− try_decode_frame(st, pkt->data, pkt->size);
2147+ try_decode_frame(st, pkt);
21482148
21492149 count++;
21502150 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t