Changeset 2004c8ba498700ca9f6fe616a3d076ff9a5d59ee

Show
Ignore:
Timestamp:
10/18/07 20:18:09 (11 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1192731489 +0000
git-parent:

[fc5954abbb4cb84a170ff960e88f90a60a4d1794]

git-author:
Laurent Aimar <fenrir@videolan.org> 1192731489 +0000
Message:

Fixed closed captions channel >= 2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/input/es_out.c

    ra0429d0 r2004c8b  
    149149static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm ); 
    150150 
     151static const vlc_fourcc_t EsOutFourccClosedCaptions[4] = { 
     152    VLC_FOURCC('c', 'c', '1', ' '), 
     153    VLC_FOURCC('c', 'c', '2', ' '), 
     154    VLC_FOURCC('c', 'c', '3', ' '), 
     155    VLC_FOURCC('c', 'c', '4', ' '), 
     156}; 
     157static inline int EsOutGetClosedCaptionsChannel( vlc_fourcc_t fcc ) 
     158{ 
     159    int i; 
     160    for( i = 0; i < 4; i++ ) 
     161    { 
     162        if( fcc == EsOutFourccClosedCaptions[i] ) 
     163            return i; 
     164    } 
     165    return -1; 
     166} 
     167 
     168 
    151169/***************************************************************************** 
    152170 * input_EsOutNew: 
     
    658676        !vlc_meta_Get( p_meta, vlc_meta_Publisher) && 
    659677        vlc_dictionary_keys_count( &p_meta->extra_tags ) <= 0 ) 
    660             return; 
     678    { 
     679        return; 
     680    } 
    661681    /* Find program */ 
    662682    for( i = 0; i < p_sys->i_pgrm; i++ ) 
     
    9851005        vlc_bool_t b_decode = VLC_FALSE; 
    9861006        if( es->p_master->p_dec ) 
    987             input_DecoderGetCcState( es->p_master->p_dec, &b_decode, 
    988                                      es->fmt.i_codec == VLC_FOURCC('c','c','1',' ') ? 0 : 1 ); 
     1007        { 
     1008            int i_channel = EsOutGetClosedCaptionsChannel( es->fmt.i_codec ); 
     1009            if( i_channel != -1 ) 
     1010                input_DecoderGetCcState( es->p_master->p_dec, &b_decode, i_channel ); 
     1011        } 
    9891012        return b_decode; 
    9901013    } 
     
    10091032    if( es->p_master ) 
    10101033    { 
     1034        int i_channel; 
    10111035        if( !es->p_master->p_dec ) 
    10121036            return; 
    10131037 
    1014         if( input_DecoderSetCcState( es->p_master->p_dec, VLC_TRUE, 
    1015                                      es->fmt.i_codec == VLC_FOURCC('c','c','1',' ') ? 0 : 1 ) ) 
     1038        i_channel = EsOutGetClosedCaptionsChannel( es->fmt.i_codec ); 
     1039        if( i_channel == -1 || input_DecoderSetCcState( es->p_master->p_dec, VLC_TRUE, i_channel ) ) 
    10161040            return; 
    10171041    } 
     
    10891113    { 
    10901114        if( es->p_master->p_dec ) 
    1091             input_DecoderSetCcState( es->p_master->p_dec, VLC_FALSE, es->fmt.i_codec == VLC_FOURCC('c','c','1',' ') ? 0 : 1 ); 
     1115        { 
     1116            int i_channel = EsOutGetClosedCaptionsChannel( es->fmt.i_codec ); 
     1117            if( i_channel != -1 ) 
     1118                input_DecoderSetCcState( es->p_master->p_dec, VLC_FALSE, i_channel ); 
     1119        } 
    10921120    } 
    10931121    else