1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 10:51:51 +00:00

make any parse error in -x264encopts fatal

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20323 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
lorenm 2006-10-20 19:19:29 +00:00
parent e0025ee924
commit 11a8049263
2 changed files with 8 additions and 4 deletions

View File

@ -43,7 +43,7 @@ extern m_option_t xvidencopts_conf[];
#endif
#if defined(HAVE_X264)
extern int x264enc_set_param(m_option_t* opt, char* arg);
extern void x264enc_set_param(m_option_t* opt, char* arg);
#endif
extern m_option_t nuvopts_conf[];

View File

@ -56,6 +56,7 @@ typedef struct _h264_module_t {
extern char* passtmpfile;
static int turbo = 0;
static x264_param_t param;
static int parse_error = 0;
static int encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal){
uint8_t *p = buf;
@ -74,7 +75,7 @@ static int encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal){
static int put_image(struct vf_instance_s *vf, mp_image_t *mpi, double pts);
static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in);
int x264enc_set_param(m_option_t* opt, char* arg)
void x264enc_set_param(m_option_t* opt, char* arg)
{
static int initted = 0;
if(!initted) {
@ -115,8 +116,7 @@ int x264enc_set_param(m_option_t* opt, char* arg)
/* mark this option as done, so it's not reparsed if there's another -x264encopts */
*name = 0;
if(ret)
return 0;
parse_error |= ret;
}
if(param.rc.b_stat_write) {
@ -144,6 +144,10 @@ int x264enc_set_param(m_option_t* opt, char* arg)
static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) {
h264_module_t *mod=(h264_module_t*)vf->priv;
if(parse_error)
return 0;
mod->mux->bih->biWidth = width;
mod->mux->bih->biHeight = height;
mod->mux->aspect = (float)d_width/d_height;