Commit 0ea07e07 authored by Ilkka Ollakka's avatar Ilkka Ollakka

transcode: take fps also as rational syntas, so 30000/1001 works

parent 15b81909
...@@ -168,7 +168,7 @@ vlc_module_begin () ...@@ -168,7 +168,7 @@ vlc_module_begin ()
VB_LONGTEXT, false ) VB_LONGTEXT, false )
add_float( SOUT_CFG_PREFIX "scale", 0, SCALE_TEXT, add_float( SOUT_CFG_PREFIX "scale", 0, SCALE_TEXT,
SCALE_LONGTEXT, false ) SCALE_LONGTEXT, false )
add_float( SOUT_CFG_PREFIX "fps", 0, FPS_TEXT, add_string( SOUT_CFG_PREFIX "fps", NULL, FPS_TEXT,
FPS_LONGTEXT, false ) FPS_LONGTEXT, false )
add_bool( SOUT_CFG_PREFIX "hurry-up", false, HURRYUP_TEXT, add_bool( SOUT_CFG_PREFIX "hurry-up", false, HURRYUP_TEXT,
HURRYUP_LONGTEXT, false ) HURRYUP_LONGTEXT, false )
...@@ -349,7 +349,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -349,7 +349,7 @@ static int Open( vlc_object_t *p_this )
p_sys->f_scale = var_GetFloat( p_stream, SOUT_CFG_PREFIX "scale" ); p_sys->f_scale = var_GetFloat( p_stream, SOUT_CFG_PREFIX "scale" );
p_sys->f_fps = var_GetFloat( p_stream, SOUT_CFG_PREFIX "fps" ); p_sys->b_master_sync = var_InheritURational( p_stream, &p_sys->fps_num, &p_sys->fps_den, SOUT_CFG_PREFIX "fps" );
p_sys->b_hurry_up = var_GetBool( p_stream, SOUT_CFG_PREFIX "hurry-up" ); p_sys->b_hurry_up = var_GetBool( p_stream, SOUT_CFG_PREFIX "hurry-up" );
...@@ -467,8 +467,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -467,8 +467,7 @@ static int Open( vlc_object_t *p_this )
} }
/* Audio settings */ /* Audio settings */
p_sys->b_master_sync = var_GetBool( p_stream, SOUT_CFG_PREFIX "audio-sync" ); p_sys->b_master_sync = __MAX( p_sys->b_master_sync == VLC_SUCCESS, var_GetBool( p_stream, SOUT_CFG_PREFIX "audio-sync" ) );
if( p_sys->f_fps > 0 ) p_sys->b_master_sync = true;
p_stream->pf_add = Add; p_stream->pf_add = Add;
p_stream->pf_del = Del; p_stream->pf_del = Del;
......
...@@ -43,7 +43,6 @@ struct sout_stream_sys_t ...@@ -43,7 +43,6 @@ struct sout_stream_sys_t
config_chain_t *p_video_cfg; config_chain_t *p_video_cfg;
int i_vbitrate; int i_vbitrate;
double f_scale; double f_scale;
double f_fps;
unsigned int i_width, i_maxwidth; unsigned int i_width, i_maxwidth;
unsigned int i_height, i_maxheight; unsigned int i_height, i_maxheight;
bool b_deinterlace; bool b_deinterlace;
...@@ -52,6 +51,7 @@ struct sout_stream_sys_t ...@@ -52,6 +51,7 @@ struct sout_stream_sys_t
int i_threads; int i_threads;
bool b_high_priority; bool b_high_priority;
bool b_hurry_up; bool b_hurry_up;
unsigned int fps_num,fps_den;
char *psz_vf2; char *psz_vf2;
......
...@@ -992,10 +992,10 @@ bool transcode_video_add( sout_stream_t *p_stream, es_format_t *p_fmt, ...@@ -992,10 +992,10 @@ bool transcode_video_add( sout_stream_t *p_stream, es_format_t *p_fmt,
* all the characteristics of the decoded stream yet */ * all the characteristics of the decoded stream yet */
id->b_transcode = true; id->b_transcode = true;
if( p_sys->f_fps > 0 ) if( p_sys->fps_num )
{ {
id->p_encoder->fmt_out.video.i_frame_rate = (p_sys->f_fps * ENC_FRAMERATE_BASE); id->p_encoder->fmt_out.video.i_frame_rate = (p_sys->fps_num );
id->p_encoder->fmt_out.video.i_frame_rate_base = ENC_FRAMERATE_BASE; id->p_encoder->fmt_out.video.i_frame_rate_base = (p_sys->fps_den ? p_sys->fps_den : 1);
} }
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment