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
1841 return enc->codec_id != CODEC_ID_NONE && val != 0;1841 return enc->codec_id != CODEC_ID_NONE && val != 0;
1842}1842}
1843 1843
1844static int try_decode_frame(AVStream *st, const uint8_t *data, int size)1844static int try_decode_frame(AVStream *st, AVPacket *avpkt)
1845{1845{
1846 int16_t *samples;1846 int16_t *samples;
1847 AVCodec *codec;1847 AVCodec *codec;
@@ -1860,16 +1860,16 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size) · 12 unmodified lines
1860 if(!has_codec_parameters(st->codec)){1860 if(!has_codec_parameters(st->codec)){
1861 switch(st->codec->codec_type) {1861 switch(st->codec->codec_type) {
1862 case CODEC_TYPE_VIDEO:1862 case CODEC_TYPE_VIDEO:
1863 ret = avcodec_decode_video(st->codec, &picture,1863 ret = avcodec_decode_video2(st->codec, &picture,
1864 &got_picture, data, size);1864 &got_picture, avpkt);
1865 break;1865 break;
1866 case CODEC_TYPE_AUDIO:1866 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);
1868 samples = av_malloc(data_size);1868 samples = av_malloc(data_size);
1869 if (!samples)1869 if (!samples)
1870 goto fail;1870 goto fail;
1871 ret = avcodec_decode_audio2(st->codec, samples,1871 ret = avcodec_decode_audio3(st->codec, samples,
1872 &data_size, data, size);1872 &data_size, avpkt);
1873 av_free(samples);1873 av_free(samples);
1874 break;1874 break;
1875 default:1875 default:
@@ -2144,7 +2144,7 @@ int av_find_stream_info(AVFormatContext *ic) · 268 unmodified lines
2144 st->codec->codec_id == CODEC_ID_PPM ||2144 st->codec->codec_id == CODEC_ID_PPM ||
2145 st->codec->codec_id == CODEC_ID_SHORTEN ||2145 st->codec->codec_id == CODEC_ID_SHORTEN ||
2146 (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)2146 (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);
2148 2148
2149 count++;2149 count++;
2150 }2150 }

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