changeset 31589:ef92321146a1

Make it possible to set all options for lavc audio encoder.
author reimar
date Sat, 10 Jul 2010 07:25:44 +0000
parents e8bb6ecadfbc
children dd1dc0ff5283
files libmpcodecs/ae_lavc.c libmpcodecs/ve_lavc.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ae_lavc.c	Sat Jul 10 02:25:07 2010 +0000
+++ b/libmpcodecs/ae_lavc.c	Sat Jul 10 07:25:44 2010 +0000
@@ -31,6 +31,7 @@
 #include "libmpdemux/muxer.h"
 #include "ae_lavc.h"
 #include "help_mp.h"
+#include "av_opts.h"
 #include "libaf/af_format.h"
 #include "libaf/reorder_ch.h"
 #include "libavcodec/avcodec.h"
@@ -42,6 +43,7 @@
 extern int  lavc_param_abitrate;
 extern int  lavc_param_atag;
 extern int  lavc_param_audio_global_header;
+extern char *lavc_param_audio_avopt;
 extern int  avcodec_initialized;
 static int compressed_frame_size = 0;
 #ifdef CONFIG_LIBAVFORMAT
@@ -232,6 +234,12 @@
                 lavc_actx->bit_rate = encoder->params.bitrate = lavc_param_abitrate * 1000;
         else
                 lavc_actx->bit_rate = encoder->params.bitrate = lavc_param_abitrate;
+        if(lavc_param_audio_avopt){
+            if(parse_avopts(lavc_actx, lavc_param_audio_avopt) < 0){
+                mp_msg(MSGT_MENCODER,MSGL_ERR, "Your options /%s/ look like gibberish to me pal\n", lavc_param_audio_avopt);
+                return 0;
+            }
+        }
 
 
 	/*
--- a/libmpcodecs/ve_lavc.c	Sat Jul 10 02:25:07 2010 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Jul 10 07:25:44 2010 +0000
@@ -180,6 +180,7 @@
 int lavc_param_abitrate = 224;
 int lavc_param_audio_global_header= 0;
 static char *lavc_param_avopt = NULL;
+char *lavc_param_audio_avopt = NULL;
 
 #include "m_option.h"
 
@@ -328,6 +329,7 @@
         {"b_sensitivity", &lavc_param_b_sensitivity, CONF_TYPE_INT, CONF_RANGE, 1, INT_MAX, NULL},
 	{"level", &lavc_param_level, CONF_TYPE_INT, CONF_RANGE, INT_MIN, INT_MAX, NULL},
         {"o", &lavc_param_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL},
+        {"audio_o", &lavc_param_audio_avopt, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };