summaryrefslogtreecommitdiff
path: root/libavcodec
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
parent37f4a976b374398a846b354cf16417b9a81d57e2 (diff)
lavc: add sample rate and channel layout to AVFrame.
Rationale is the same as for video width/height etc.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h16
-rw-r--r--libavcodec/utils.c4
-rw-r--r--libavcodec/version.h2
3 files changed, 21 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8020582b6e..bec13e7c1a 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1207,6 +1207,22 @@ typedef struct AVFrame {
* - decoding: Set by libavcodec.
*/
uint8_t motion_subsample_log2;
+
+ /**
+ * Sample rate of the audio data.
+ *
+ * - encoding: unused
+ * - decoding: set by get_buffer()
+ */
+ int sample_rate;
+
+ /**
+ * Channel layout of the audio data.
+ *
+ * - encoding: unused
+ * - decoding: set by get_buffer()
+ */
+ uint64_t channel_layout;
} AVFrame;
struct AVCodecInternal;
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);
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 5119874379..be39f4ffca 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
*/
#define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 12
+#define LIBAVCODEC_VERSION_MINOR 13
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \