You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavc: Fix ticket 6024, truncated mode decoding
The assumption that avcodec_send_packet makes regarding decoders consuming the entire packet is not true if the codec supports truncated decoding mode and the truncated flag is turned on. Steps to reproduce: ./ffmpeg_g -flags truncated \ -i "http://samples.ffmpeg.org/MPEG2/test-ebu-422.40000.pakets.ts" \ -c:v ffv1 -c:a copy -y /tmp/truncated.nut Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
5b74ebe937
commit
6b517a194d
@@ -2788,7 +2788,7 @@ static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
|
|||||||
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
|
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||||
ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame,
|
ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame,
|
||||||
&got_frame, pkt);
|
&got_frame, pkt);
|
||||||
if (ret >= 0)
|
if (ret >= 0 && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED))
|
||||||
ret = pkt->size;
|
ret = pkt->size;
|
||||||
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
|
ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
|
||||||
|
Reference in New Issue
Block a user