summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-05 03:09:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-05 03:30:24 +0200
commitb000b86e1dd03c4ff89cd63a6fa88fc280947c94 (patch)
tree8ba961dc8c013885d7bdfe944fb7cb31d5dc6d95 /libavcodec/ac3enc.c
parent9a5624a0f1b205e966391645a512c6dccdce42cd (diff)
parentaf1ca249e8eb685823dd0dade3aa3c1d119a61ec (diff)
Merge remote branch 'qatar/master'
* qatar/master: (23 commits) doc: Check standalone compilation before submitting new components. Fix standalone compilation of pipe protocol. Fix standalone compilation of ac3_fixed encoder. Fix standalone compilation of binkaudio_dct / binkaudio_rdft decoders. Fix standalone compilation of IMC decoder. Fix standalone compilation of WTV demuxer. Fix standalone compilation of MXPEG decoder. flashsv: K&R cosmetics matroskaenc: fix memory leak vc1: make overlap filter for I-frames bit-exact. vc1dec: use s->start/end_mb_y instead of passing them as function args. Revert "VC1: merge idct8x8, coeff adjustments and put_pixels." Replace strncpy() with av_strlcpy(). indeo3: Eliminate use of long. get_bits: make cache unsigned to eliminate undefined signed overflow. asfdec: fix assert failure on invalid files avfilter: check malloc return values. Not pulled as reason for reindent is not pulled: mpegvideo: reindent. nutenc: check malloc return values. Not pulled due to much simpler solution in ffmpeg *: don't av_malloc(0). ... Conflicts: doc/developer.texi libavcodec/Makefile libavcodec/get_bits.h libavcodec/mpegvideo.c libavformat/Makefile libavutil/log.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r--libavcodec/ac3enc.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 48df4b7e6b..90d65bf44d 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -33,6 +33,7 @@
#include "libavutil/audioconvert.h"
#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
#include "libavutil/crc.h"
#include "libavutil/opt.h"
#include "avcodec.h"
@@ -1551,10 +1552,10 @@ static void dprint_options(AVCodecContext *avctx)
char strbuf[32];
switch (s->bitstream_id) {
- case 6: strncpy(strbuf, "AC-3 (alt syntax)", 32); break;
- case 8: strncpy(strbuf, "AC-3 (standard)", 32); break;
- case 9: strncpy(strbuf, "AC-3 (dnet half-rate)", 32); break;
- case 10: strncpy(strbuf, "AC-3 (dnet quater-rate", 32); break;
+ case 6: av_strlcpy(strbuf, "AC-3 (alt syntax)", 32); break;
+ case 8: av_strlcpy(strbuf, "AC-3 (standard)", 32); break;
+ case 9: av_strlcpy(strbuf, "AC-3 (dnet half-rate)", 32); break;
+ case 10: av_strlcpy(strbuf, "AC-3 (dnet quater-rate", 32); break;
default: snprintf(strbuf, 32, "ERROR");
}
av_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
@@ -1581,9 +1582,9 @@ static void dprint_options(AVCodecContext *avctx)
if (opt->audio_production_info) {
av_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
switch (opt->room_type) {
- case 0: strncpy(strbuf, "notindicated", 32); break;
- case 1: strncpy(strbuf, "large", 32); break;
- case 2: strncpy(strbuf, "small", 32); break;
+ case 0: av_strlcpy(strbuf, "notindicated", 32); break;
+ case 1: av_strlcpy(strbuf, "large", 32); break;
+ case 2: av_strlcpy(strbuf, "small", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->room_type);
}
av_dlog(avctx, "room_type: %s\n", strbuf);
@@ -1595,9 +1596,9 @@ static void dprint_options(AVCodecContext *avctx)
av_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
if (s->channel_mode == AC3_CHMODE_STEREO) {
switch (opt->dolby_surround_mode) {
- case 0: strncpy(strbuf, "notindicated", 32); break;
- case 1: strncpy(strbuf, "on", 32); break;
- case 2: strncpy(strbuf, "off", 32); break;
+ case 0: av_strlcpy(strbuf, "notindicated", 32); break;
+ case 1: av_strlcpy(strbuf, "on", 32); break;
+ case 2: av_strlcpy(strbuf, "off", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_mode);
}
av_dlog(avctx, "dsur_mode: %s\n", strbuf);
@@ -1609,9 +1610,9 @@ static void dprint_options(AVCodecContext *avctx)
if (s->bitstream_id == 6) {
if (opt->extended_bsi_1) {
switch (opt->preferred_stereo_downmix) {
- case 0: strncpy(strbuf, "notindicated", 32); break;
- case 1: strncpy(strbuf, "ltrt", 32); break;
- case 2: strncpy(strbuf, "loro", 32); break;
+ case 0: av_strlcpy(strbuf, "notindicated", 32); break;
+ case 1: av_strlcpy(strbuf, "ltrt", 32); break;
+ case 2: av_strlcpy(strbuf, "loro", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->preferred_stereo_downmix);
}
av_dlog(avctx, "dmix_mode: %s\n", strbuf);
@@ -1628,23 +1629,23 @@ static void dprint_options(AVCodecContext *avctx)
}
if (opt->extended_bsi_2) {
switch (opt->dolby_surround_ex_mode) {
- case 0: strncpy(strbuf, "notindicated", 32); break;
- case 1: strncpy(strbuf, "on", 32); break;
- case 2: strncpy(strbuf, "off", 32); break;
+ case 0: av_strlcpy(strbuf, "notindicated", 32); break;
+ case 1: av_strlcpy(strbuf, "on", 32); break;
+ case 2: av_strlcpy(strbuf, "off", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_ex_mode);
}
av_dlog(avctx, "dsurex_mode: %s\n", strbuf);
switch (opt->dolby_headphone_mode) {
- case 0: strncpy(strbuf, "notindicated", 32); break;
- case 1: strncpy(strbuf, "on", 32); break;
- case 2: strncpy(strbuf, "off", 32); break;
+ case 0: av_strlcpy(strbuf, "notindicated", 32); break;
+ case 1: av_strlcpy(strbuf, "on", 32); break;
+ case 2: av_strlcpy(strbuf, "off", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_headphone_mode);
}
av_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
switch (opt->ad_converter_type) {
- case 0: strncpy(strbuf, "standard", 32); break;
- case 1: strncpy(strbuf, "hdcd", 32); break;
+ case 0: av_strlcpy(strbuf, "standard", 32); break;
+ case 1: av_strlcpy(strbuf, "hdcd", 32); break;
default: snprintf(strbuf, 32, "ERROR (%d)", opt->ad_converter_type);
}
av_dlog(avctx, "ad_conv_type: %s\n", strbuf);