Commit 6de833a4 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* fixed a problem with sub-fps overriding

  If subtitle format  doesn't have their own reference, they should define 25fps as the the standard reference, BUT NOT GLOBALLY. Cause then ALL subtitle formats will use this correction factor of 25fps.
parent 7216315d
......@@ -190,12 +190,15 @@ static int Open ( vlc_object_t *p_this )
/* Get the FPS */
p_sys->i_microsecperframe = 40000; /* default to 25 fps */
f_fps = var_CreateGetFloat( p_demux, "sub-fps" );
if( f_fps >= 1.0 )
{
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
}
else
{
p_sys->i_microsecperframe = 0;
}
f_fps = var_CreateGetFloat( p_demux, "sub-original-fps" );
if( f_fps >= 1.0 )
......@@ -680,6 +683,10 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
int i_stop;
unsigned int i;
int i_microsecperframe = 40000; /* default to 25 fps */
if( p_sys->i_microsecperframe > 0 )
i_microsecperframe = p_sys->i_microsecperframe;
p_subtitle->i_start = 0;
p_subtitle->i_stop = 0;
p_subtitle->psz_text = NULL;
......@@ -709,8 +716,8 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
}
}
p_subtitle->i_start = (int64_t)i_start * p_sys->i_microsecperframe;
p_subtitle->i_stop = (int64_t)i_stop * p_sys->i_microsecperframe;
p_subtitle->i_start = (int64_t)i_start * i_microsecperframe;
p_subtitle->i_stop = (int64_t)i_stop * i_microsecperframe;
p_subtitle->psz_text = strndup( buffer_text, MAX_LINE );
return( 0 );
}
......
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