aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-07-15 14:36:22 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-07-19 23:41:03 +0200
commit11ce1cf9a79954ecc9ac7640ba0c3dc9e0b34f4a (patch)
tree156d2cf7bbf0f815923bed83dd98c795e739d5d9 /libavcodec/utils.c
parente4c00aca966e0b22777f3d2d6fe9c993151cc5f8 (diff)
downloadffmpeg-11ce1cf9a79954ecc9ac7640ba0c3dc9e0b34f4a.tar.gz
lavc: add debug info about skipped samples.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 78e0e11fbe..5d5f5a41a8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1651,11 +1651,15 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
side= av_packet_get_side_data(avctx->pkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
if(side && side_size>=10) {
avctx->internal->skip_samples = AV_RL32(side);
+ av_log(avctx, AV_LOG_DEBUG, "skip %d samples due to side data\n",
+ avctx->internal->skip_samples);
}
if (avctx->internal->skip_samples) {
if(frame->nb_samples <= avctx->internal->skip_samples){
*got_frame_ptr = 0;
avctx->internal->skip_samples -= frame->nb_samples;
+ av_log(avctx, AV_LOG_DEBUG, "skip whole frame, skip left: %d\n",
+ avctx->internal->skip_samples);
} else {
av_samples_copy(frame->extended_data, frame->extended_data, 0, avctx->internal->skip_samples,
frame->nb_samples - avctx->internal->skip_samples, avctx->channels, frame->format);
@@ -1665,6 +1669,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
if(frame->pkt_dts!=AV_NOPTS_VALUE)
frame->pkt_dts += av_rescale_q(avctx->internal->skip_samples,(AVRational){1, avctx->sample_rate}, avctx->pkt_timebase);
}
+ av_log(avctx, AV_LOG_DEBUG, "skip %d/%d samples\n",
+ avctx->internal->skip_samples, frame->nb_samples);
frame->nb_samples -= avctx->internal->skip_samples;
avctx->internal->skip_samples = 0;
}