aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-05-04 19:12:31 +0200
committerAnton Khirnov <anton@khirnov.net>2012-05-07 07:08:03 +0200
commit828bd088f3f74dcdb8451d58557b0d8caefa3227 (patch)
treee5086b5a07fb63939021eae2a5adad38330fcb38 /libavcodec/utils.c
parent37f4a976b374398a846b354cf16417b9a81d57e2 (diff)
downloadffmpeg-828bd088f3f74dcdb8451d58557b0d8caefa3227.tar.gz
lavc: add sample rate and channel layout to AVFrame.
Rationale is the same as for video width/height etc.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 4492486771..2e8a86c1fa 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -356,6 +356,10 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
else frame->pkt_pts = AV_NOPTS_VALUE;
frame->reordered_opaque = avctx->reordered_opaque;
+ frame->sample_rate = avctx->sample_rate;
+ frame->format = avctx->sample_fmt;
+ frame->channel_layout = avctx->channel_layout;
+
if (avctx->debug & FF_DEBUG_BUFFERS)
av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p, "
"internal audio buffer used\n", frame);