summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-09 22:48:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-09 23:02:33 +0200
commit6bfb3042b3158f0a87629ab0c126cccb269c3d5a (patch)
tree08699d0bcef99f30b084db2980759af901f8af91 /libavcodec
parent7f66912f1a303a369f6ac435d630971d74310a81 (diff)
parent679a973e9701576b1c3c6d71838c45c10ac20564 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avconv: use default alignment for audio buffer avcodec: use align == 0 for default alignment in avcodec_fill_audio_frame() avutil: use align == 0 for default alignment in audio sample buffer functions avutil: allow NULL linesize in av_samples_fill_arrays() and av_samples_alloc() avconv: remove OutputStream.picref. avconv: only set SAR once on the decoded frame. avcodec: validate the channel layout vs. channel count for decoders audioconvert: make av_get_channel_layout accept composite names. avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt() Conflicts: doc/APIchanges ffmpeg.c libavcodec/utils.c libavcodec/version.h libavutil/audioconvert.c libavutil/audioconvert.h libavutil/avutil.h libavutil/samplefmt.c libavutil/samplefmt.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/utils.c18
-rw-r--r--libavcodec/version.h2
3 files changed, 15 insertions, 7 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index de9b245879..56fc15cad1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4018,7 +4018,7 @@ int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
* @param sample_fmt sample format
* @param buf buffer to use for frame data
* @param buf_size size of buffer
- * @param align plane size sample alignment
+ * @param align plane size sample alignment (0 = default)
* @return 0 on success, negative error code on failure
*/
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ab34b40c62..f6c9466fbc 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -319,7 +319,7 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
buf_size = av_samples_get_buffer_size(NULL, avctx->channels,
frame->nb_samples, avctx->sample_fmt,
- 32);
+ 0);
if (buf_size < 0)
return AVERROR(EINVAL);
@@ -361,7 +361,7 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
}
if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
avctx->sample_fmt, buf->data[0],
- buf->audio_data_size, 32)))
+ buf->audio_data_size, 0)))
return ret;
if (frame->extended_data == frame->data)
@@ -913,10 +913,18 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
}
}
- if (av_codec_is_decoder(avctx->codec) && !avctx->bit_rate)
- avctx->bit_rate = get_bit_rate(avctx);
-
ret=0;
+
+ if (av_codec_is_decoder(avctx->codec)) {
+ if (!avctx->bit_rate)
+ avctx->bit_rate = get_bit_rate(avctx);
+ /* validate channel layout from the decoder */
+ if (avctx->channel_layout &&
+ av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels) {
+ av_log(avctx, AV_LOG_WARNING, "channel layout does not match number of channels\n");
+ avctx->channel_layout = 0;
+ }
+ }
end:
entangled_thread_counter--;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 47591fde76..6c631d8045 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 14
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \