summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-03-24 02:12:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-03-24 02:16:11 +0100
commit2fd41c9067fc67b40f80e9cbd4787018009040db (patch)
tree378cc399057a6089f3f06bc62f0eff97d3ada56b /libavformat/matroskaenc.c
parent00dc0206cb5b351a66d7cce77b8a65fabe6ea7da (diff)
parent4ec153bb66a95da46c98e269bd0aa787e6172ed3 (diff)
Merge remote-tracking branch 'newdev/master'
* newdev/master: avio: make udp_set_remote_url/get_local_port internal. asfdec: also subtract preroll when reading simple index object matroskaenc: remove a variable that's unused after bc17bd9. avio: cosmetics - nicer vertical alignment. Remove unnecessary icc version checks Disable 'attribute "foo" ignored' warnings from icc rtsp: Don't use a locale dependent format string Add xd55 codec tag for XDCAM HD422 720p25 CBR files. configure: get libavcodec version from new version.h header lavc: move the version macros to a new installed header. matroskaenc: simplify get_aac_sample_rates by using ff_mpeg4audio_get_config Do not use format string "%0.3f" for RTSP Range field. Add apply_window_int16() to DSPContext with x86-optimized versions and use it in the ac3_fixed encoder. Document usage of import libraries created by dlltool configure: Set the correct lib target for arm/wince dlltool fate: simplify regression-funcs.sh fate: add support for multithread testing Conflicts: libavformat/rtspdec.c libavutil/attributes.h libavutil/internal.h libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index df192a1cb3..973f31c129 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -438,29 +438,15 @@ static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContex
static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate)
{
- int sri;
+ MPEG4AudioConfig mp4ac;
- if (codec->extradata_size < 2) {
- av_log(s, AV_LOG_WARNING, "No AAC extradata, unable to determine samplerate.\n");
+ if (ff_mpeg4audio_get_config(&mp4ac, codec->extradata, codec->extradata_size) < 0) {
+ av_log(s, AV_LOG_WARNING, "Error parsing AAC extradata, unable to determine samplerate.\n");
return;
}
- sri = ((codec->extradata[0] << 1) & 0xE) | (codec->extradata[1] >> 7);
- if (sri > 12) {
- av_log(s, AV_LOG_WARNING, "AAC samplerate index out of bounds\n");
- return;
- }
- *sample_rate = ff_mpeg4audio_sample_rates[sri];
-
- // if sbr, get output sample rate as well
- if (codec->extradata_size == 5) {
- sri = (codec->extradata[4] >> 3) & 0xF;
- if (sri > 12) {
- av_log(s, AV_LOG_WARNING, "AAC output samplerate index out of bounds\n");
- return;
- }
- *output_sample_rate = ff_mpeg4audio_sample_rates[sri];
- }
+ *sample_rate = mp4ac.sample_rate;
+ *output_sample_rate = mp4ac.ext_sample_rate;
}
static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)