summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-21 20:12:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-21 20:34:32 +0200
commita1bb0823a96ee2d94c7c2f8080313e744ffbff5f (patch)
tree7d21a2efb78ea8e1e79c7d9c5d166d5f3170bf0b /libavcodec
parent307562be98b49b94a621d5fbf7db7ab53308db87 (diff)
libavcodec: correct consumed bytes for decoders
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3a858b919f..15dd05ac34 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1482,8 +1482,11 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
emms_c(); //needed to avoid an emms_c() call before every return;
avctx->pkt = NULL;
- if (did_split)
+ if (did_split) {
ff_packet_free_side_data(&tmp);
+ if(ret == tmp.size)
+ ret = avpkt->size;
+ }
if (*got_picture_ptr){
avctx->frame_number++;
@@ -1583,8 +1586,11 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
}
avctx->pkt = NULL;
- if (did_split)
+ if (did_split) {
ff_packet_free_side_data(&tmp);
+ if(ret == tmp.size)
+ ret = avpkt->size;
+ }
}
return ret;
}