-lavcopts aglobal

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17843 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2006-03-13 02:40:09 +00:00
parent e8954b5bf9
commit 3d19a5474d
2 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,7 @@ static AVCodecContext *lavc_actx;
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 mpae_init_lavc(audio_encoder_t *encoder)
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)
{

View File

@ -163,6 +163,7 @@ static int lavc_param_video_global_header= 0;
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 @@ m_option_t lavcopts_conf[]={
{"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