Commit 8bc4accc authored by wm4's avatar wm4 Committed by Anton Khirnov

lavf: use new decode API

Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 35846d93
...@@ -1945,22 +1945,22 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -1945,22 +1945,22 @@ FF_ENABLE_DEPRECATION_WARNINGS
(!st->codec_info_nb_frames && (!st->codec_info_nb_frames &&
(avctx->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)))) { (avctx->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)))) {
got_picture = 0; got_picture = 0;
switch (avctx->codec_type) { if (avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
case AVMEDIA_TYPE_VIDEO: avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
ret = avcodec_decode_video2(avctx, frame, ret = avcodec_send_packet(avctx, &pkt);
&got_picture, &pkt); if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
break; break;
case AVMEDIA_TYPE_AUDIO: if (ret >= 0)
ret = avcodec_decode_audio4(avctx, frame, &got_picture, &pkt); pkt.size = 0;
break; ret = avcodec_receive_frame(avctx, frame);
default: if (ret >= 0)
break; got_picture = 1;
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
ret = 0;
} }
if (ret >= 0) { if (ret >= 0) {
if (got_picture) if (got_picture)
st->info->nb_decoded_frames++; st->info->nb_decoded_frames++;
pkt.data += ret;
pkt.size -= ret;
ret = got_picture; ret = got_picture;
} }
} }
......
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