diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-07-11 04:23:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-07-11 04:23:25 +0200 |
commit | 3602ad7ee6fe5caa402e61aa04ac695e1c46fe5e (patch) | |
tree | 5d89faee8784c9f755974a0822a3e9e90673494e /libavcodec/ac3dec.c | |
parent | 3b2d285afbd6304505a96b71877cdfda13f4565c (diff) | |
parent | 142e76f1055de5dde44696e71a5f63f2cb11dedf (diff) | |
download | ffmpeg-3602ad7ee6fe5caa402e61aa04ac695e1c46fe5e.tar.gz |
Merge commit '142e76f1055de5dde44696e71a5f63f2cb11dedf'
* commit '142e76f1055de5dde44696e71a5f63f2cb11dedf':
swscale: fix crash with dithering due incorrect offset calculation.
matroskadec: fix stupid typo (!= -> ==)
build: remove duplicates from order-only directory prerequisite list
build: rework rules for things in the tools dir
configure: fix --cpu=host with gcc 4.6
ARM: use const macro to define constant data in asm
bitdepth: simplify FUNC/FUNCC macros
dsputil: remove ff_emulated_edge_mc macro used in one place
9/10-bit: simplify clipping macros
matroskadec: reindent
matroskadec: defer parsing of cues element until we seek.
lavc: add support for codec-specific defaults.
lavc: make avcodec_alloc_context3 officially public.
lavc: remove a half-working attempt at different defaults for audio/video codecs.
ac3dec: add a drc_scale private option
lavf: add avformat_find_stream_info()
lavc: introduce avcodec_open2() as a replacement for avcodec_open().
Conflicts:
Makefile
libavcodec/utils.c
libavformat/avformat.h
libswscale/swscale_internal.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r-- | libavcodec/ac3dec.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ca6f18ff3c..6e378bb59c 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -30,6 +30,7 @@ #include <string.h> #include "libavutil/crc.h" +#include "libavutil/opt.h" #include "internal.h" #include "aac_ac3_parser.h" #include "ac3_parser.h" @@ -1438,6 +1439,20 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx) return 0; } +#define OFFSET(x) offsetof(AC3DecodeContext, x) +#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM) +static const AVOption options[] = { + { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR }, + { NULL}, +}; + +static const AVClass ac3_decoder_class = { + .class_name = "(E-)AC3 decoder", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_ac3_decoder = { .name = "ac3", .type = AVMEDIA_TYPE_AUDIO, @@ -1450,6 +1465,7 @@ AVCodec ff_ac3_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .priv_class = &ac3_decoder_class, }; #if CONFIG_EAC3_DECODER @@ -1465,5 +1481,6 @@ AVCodec ff_eac3_decoder = { .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .priv_class = &ac3_decoder_class, }; #endif |