OSDN Git Service

mp2 encoder: make 128k the default bitrate.
authorAnton Khirnov <anton@khirnov.net>
Sat, 20 Aug 2011 14:20:27 +0000 (16:20 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 22 Aug 2011 05:17:38 +0000 (07:17 +0200)
libavcodec/mpegaudioenc.c

index 96c0fec..1cadef7 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 #include "put_bits.h"
 
 #define FRAC_BITS   15   /* fractional bits for sb_samples and dct */
@@ -759,6 +760,11 @@ static av_cold int MPA_encode_close(AVCodecContext *avctx)
     return 0;
 }
 
+static const AVCodecDefault mp2_defaults[] = {
+    { "b",    "128k" },
+    { NULL },
+};
+
 AVCodec ff_mp2_encoder = {
     .name           = "mp2",
     .type           = AVMEDIA_TYPE_AUDIO,
@@ -770,4 +776,5 @@ AVCodec ff_mp2_encoder = {
     .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
     .supported_samplerates= (const int[]){44100, 48000,  32000, 22050, 24000, 16000, 0},
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
+    .defaults       = mp2_defaults,
 };