changeset 17842:7d5343254436

-lavcopts aglobal
author michael
date Mon, 13 Mar 2006 02:40:09 +0000
parents 73db10d5f2e3
children 6bd233d56c25
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	Sun Mar 12 23:06:09 2006 +0000
+++ b/libmpcodecs/ae_lavc.c	Mon Mar 13 02:40:09 2006 +0000
@@ -24,6 +24,7 @@
 extern char *lavc_param_acodec;
 extern int  lavc_param_abitrate;
 extern int  lavc_param_atag;
+extern int  lavc_param_audio_global_header;
 extern int  avcodec_inited;
 static int compressed_frame_size = 0;
 #if defined(USE_LIBAVFORMAT) ||  defined(USE_LIBAVFORMAT_SO)
@@ -206,6 +207,13 @@
 		int framesize = (blkalign - 4 * lavc_actx->channels) * 8 / (4 * lavc_actx->channels) + 1;
 		lavc_actx->bit_rate = lavc_actx->sample_rate*8*blkalign/framesize;
 	}
+        if((lavc_param_audio_global_header&1)
+        /*|| (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))*/){
+                lavc_actx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+        }
+        if(lavc_param_audio_global_header&2){
+                lavc_actx->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
+        }
 
 	if(avcodec_open(lavc_actx, lavc_acodec) < 0)
 	{
--- a/libmpcodecs/ve_lavc.c	Sun Mar 12 23:06:09 2006 +0000
+++ b/libmpcodecs/ve_lavc.c	Mon Mar 13 02:40:09 2006 +0000
@@ -163,6 +163,7 @@
 char *lavc_param_acodec = "mp2";
 int lavc_param_atag = 0;
 int lavc_param_abitrate = 224;
+int lavc_param_audio_global_header= 0;
 
 #include "m_option.h"
 
@@ -316,6 +317,7 @@
 	{"bidir_refine", &lavc_param_bidir_refine, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL},
 	{"sc_factor", &lavc_param_sc_factor, CONF_TYPE_INT, CONF_RANGE, 1, INT_MAX, NULL},
 	{"vglobal", &lavc_param_video_global_header, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL},
+	{"aglobal", &lavc_param_audio_global_header, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 #endif