Originally committed as revision 12671 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -306,8 +306,9 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o · 305 unmodified lines | ||
| 306 | 306 | |
| 307 | 307 | # libavformat dependencies |
| 308 | 308 | OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o |
| 309 | −OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o | |
| 310 | −OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o | |
| 309 | +OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o | |
| 310 | +OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o | |
| 311 | +OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o | |
| 311 | 312 | OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o |
| 312 | 313 | OBJS-$(CONFIG_OGG_MUXER) += xiph.o |
| 313 | 314 | OBJS-$(CONFIG_RTP_MUXER) += mpegvideo.o |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | #include "riff.h" |
| 34 | 34 | #include "intfloat_readwrite.h" |
| 35 | 35 | #include "matroska.h" |
| 36 | +#include "libavcodec/mpeg4audio.h" | |
| 36 | 37 | |
| 37 | 38 | typedef struct Track { |
| 38 | 39 | MatroskaTrackType type; |
| @@ -1997,14 +1998,10 @@ matroska_aac_profile (char *codec_id) · 1958 unmodified lines | ||
| 1997 | 1998 | static int |
| 1998 | 1999 | matroska_aac_sri (int samplerate) |
| 1999 | 2000 | { |
| 2000 | − static const int aac_sample_rates[] = { | |
| 2001 | − 96000, 88200, 64000, 48000, 44100, 32000, | |
| 2002 | − 24000, 22050, 16000, 12000, 11025, 8000, | |
| 2003 | − }; | |
| 2004 | 2001 | int sri; |
| 2005 | 2002 | |
| 2006 | − for (sri=0; sri<ARRAY_SIZE(aac_sample_rates); sri++) | |
| 2007 | − if (aac_sample_rates[sri] == samplerate) | |
| 2003 | + for (sri=0; sri<ARRAY_SIZE(ff_mpeg4audio_sample_rates); sri++) | |
| 2004 | + if (ff_mpeg4audio_sample_rates[sri] == samplerate) | |
| 2008 | 2005 | break; |
| 2009 | 2006 | return sri; |
| 2010 | 2007 | } |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #include "xiph.h" |
| 26 | 26 | #include "matroska.h" |
| 27 | 27 | #include "avc.h" |
| 28 | +#include "libavcodec/mpeg4audio.h" | |
| 28 | 29 | |
| 29 | 30 | typedef struct ebml_master { |
| 30 | 31 | offset_t pos; ///< absolute offset in the file where the master's elements start |
| @@ -438,10 +439,6 @@ static int put_flac_codecpriv(AVFormatContext *s, ByteIOContext *pb, AVCodecCont · 407 unmodified lines | ||
| 438 | 439 | |
| 439 | 440 | static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate) |
| 440 | 441 | { |
| 441 | − static const int aac_sample_rates[] = { | |
| 442 | − 96000, 88200, 64000, 48000, 44100, 32000, | |
| 443 | − 24000, 22050, 16000, 12000, 11025, 8000, | |
| 444 | − }; | |
| 445 | 442 | int sri; |
| 446 | 443 | |
| 447 | 444 | if (codec->extradata_size < 2) { |
| @@ -454,7 +451,7 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int · 6 unmodified lines | ||
| 454 | 451 | av_log(s, AV_LOG_WARNING, "AAC samplerate index out of bounds\n"); |
| 455 | 452 | return; |
| 456 | 453 | } |
| 457 | − *sample_rate = aac_sample_rates[sri]; | |
| 454 | + *sample_rate = ff_mpeg4audio_sample_rates[sri]; | |
| 458 | 455 | |
| 459 | 456 | // if sbr, get output sample rate as well |
| 460 | 457 | if (codec->extradata_size == 5) { |
| @@ -463,7 +460,7 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int · 2 unmodified lines | ||
| 463 | 460 | av_log(s, AV_LOG_WARNING, "AAC output samplerate index out of bounds\n"); |
| 464 | 461 | return; |
| 465 | 462 | } |
| 466 | − *output_sample_rate = aac_sample_rates[sri]; | |
| 463 | + *output_sample_rate = ff_mpeg4audio_sample_rates[sri]; | |
| 467 | 464 | } |
| 468 | 465 | } |
| 469 | 466 | |