Changeset 6de833a425913c7f4fc6d0ef1b77dbd13f10526e

Show
Ignore:
Timestamp:
02/11/04 21:52:45 (4 years ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1099428765 +0000
git-parent:

[7216315d85b2395b7adfbe5fda75f9f83564266e]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1099428765 +0000
Message:

* 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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/subtitle.c

    r62f7a58 r6de833a  
    191191 
    192192    /* Get the FPS */ 
    193     p_sys->i_microsecperframe = 40000; /* default to 25 fps */ 
    194193    f_fps = var_CreateGetFloat( p_demux, "sub-fps" ); 
    195194    if( f_fps >= 1.0 ) 
    196195    { 
    197196        p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps ); 
     197    } 
     198    else 
     199    { 
     200        p_sys->i_microsecperframe = 0; 
    198201    } 
    199202 
     
    681684    unsigned int i; 
    682685 
     686    int i_microsecperframe = 40000; /* default to 25 fps */ 
     687    if( p_sys->i_microsecperframe > 0 )  
     688        i_microsecperframe = p_sys->i_microsecperframe; 
     689     
    683690    p_subtitle->i_start = 0; 
    684691    p_subtitle->i_stop  = 0; 
     
    710717    } 
    711718 
    712     p_subtitle->i_start = (int64_t)i_start * p_sys->i_microsecperframe; 
    713     p_subtitle->i_stop  = (int64_t)i_stop  * p_sys->i_microsecperframe; 
     719    p_subtitle->i_start = (int64_t)i_start * i_microsecperframe; 
     720    p_subtitle->i_stop  = (int64_t)i_stop  * i_microsecperframe; 
    714721    p_subtitle->psz_text = strndup( buffer_text, MAX_LINE ); 
    715722    return( 0 );