History

lavc: add sample rate and channel layout to AVFrame.

Rationale is the same as for video width/height etc.

Anton Khirnov committed 14 years ago

Commit 828bd081 parent 37f4a974 files · +24 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +16 −0
  3. libavcodec/utils.c +4 −0
  4. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2011-04-18 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2012-xx-xx - xxxxxxx - lavc 54.13.0 - avcodec.h
17+ Add sample_rate and channel_layout fields to AVFrame.
18+
1619 2012-xx-xx - xxxxxxx - lavr 0.0.1
1720 Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
1821
libavcodec/avcodec.h+16−0
@@ -1207,6 +1207,22 @@ typedef struct AVFrame { · 1206 unmodified lines
12071207 * - decoding: Set by libavcodec.
12081208 */
12091209 uint8_t motion_subsample_log2;
1210+
1211+ /**
1212+ * Sample rate of the audio data.
1213+ *
1214+ * - encoding: unused
1215+ * - decoding: set by get_buffer()
1216+ */
1217+ int sample_rate;
1218+
1219+ /**
1220+ * Channel layout of the audio data.
1221+ *
1222+ * - encoding: unused
1223+ * - decoding: set by get_buffer()
1224+ */
1225+ uint64_t channel_layout;
12101226 } AVFrame;
12111227
12121228 struct AVCodecInternal;
libavcodec/utils.c+4−0
@@ -356,6 +356,10 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame) · 355 unmodified lines
356356 else frame->pkt_pts = AV_NOPTS_VALUE;
357357 frame->reordered_opaque = avctx->reordered_opaque;
358358
359+ frame->sample_rate = avctx->sample_rate;
360+ frame->format = avctx->sample_fmt;
361+ frame->channel_layout = avctx->channel_layout;
362+
359363 if (avctx->debug & FF_DEBUG_BUFFERS)
360364 av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p, "
361365 "internal audio buffer used\n", frame);
libavcodec/version.h+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 */
2828
2929 #define LIBAVCODEC_VERSION_MAJOR 54
30−#define LIBAVCODEC_VERSION_MINOR 12
30+#define LIBAVCODEC_VERSION_MINOR 13
3131 #define LIBAVCODEC_VERSION_MICRO 0
3232
3333 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t