summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorPavel Koshevoy <pkoshevoy@gmail.com>2016-12-15 10:19:23 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-17 18:41:18 +0100
commit6b517a194da47a2d586806679ef6ca9233ee32d6 (patch)
tree2025293e3fc4ac44f21eaf9c42c4ac55c5bbd674 /libavcodec
parent5b74ebe93723323c3f7068d8ff1fb44b43d8fc67 (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 44ecc09c96..be50459b34 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2788,7 +2788,7 @@ static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame,
&got_frame, pkt);
- if (ret >= 0)
+ if (ret >= 0 && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED))
ret = pkt->size;
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,