Changeset 1f0742025c2fbfd1cbeb94f0728bdcf155091498

Show
Ignore:
Timestamp:
09/10/07 03:53:28 (1 year ago)
Author:
Bernie Purcell <bitmap@videolan.org>
git-committer:
Bernie Purcell <bitmap@videolan.org> 1189389208 +0000
git-parent:

[8b0e6890b6d468d83d29d907954826801abdea83]

git-author:
Bernie Purcell <bitmap@videolan.org> 1189389208 +0000
Message:

Select subtitle stream from the mkv container automatically
if it has a DEFAULT flag on it. User overrides for
preferred language should continue to take precedence.
The current versions of MKVToolnix correctly support DEFAULT
track tag but some older versions don't. If you want to have
subtitle streams in your mkv file, but not have them activate
by default, try remuxing any files causing you trouble, with
the current version of MKVToolnix, and turning the DEFAULT
track flag option to NO for all subtitles streams.
MKVToolnix is available from http://www.bunkus.org/videotools/mkvtoolnix/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_es_out.h

    rce3521a r1f07420  
    5555    /* set es selected for the es category(audio/video/spu) */ 
    5656    ES_OUT_SET_ES,      /* arg1= es_out_id_t*                   */ 
     57 
     58    /* set 'default' tag on es (copied across from container) */ 
     59    ES_OUT_SET_DEFAULT, /* arg1= es_out_id_t*                   */ 
    5760 
    5861    /* force selection/unselection of the ES (bypass current mode)*/ 
  • modules/demux/mkv.cpp

    r45915c7 r1f07420  
    26192619 
    26202620        tracks[i_track]->p_es = es_out_Add( sys.demuxer.out, &tracks[i_track]->fmt ); 
     2621 
     2622        /* Turn on a subtitles track if it has been flagged as default - 
     2623         * but only do this if no subtitles track has already been engaged, 
     2624         * either by an earlier 'default track' (??) or by default 
     2625         * language choice behaviour. 
     2626         */ 
     2627        if( tracks[i_track]->b_default ) 
     2628        { 
     2629            es_out_Control( sys.demuxer.out, 
     2630                            ES_OUT_SET_DEFAULT, 
     2631                            tracks[i_track]->p_es ); 
     2632        } 
    26212633 
    26222634        es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, tracks[i_track]->p_es, i_start_time ); 
  • src/input/es_out.c

    rb5d134f r1f07420  
    109109    int         i_audio_last, i_audio_id; 
    110110    int         i_sub_last, i_sub_id; 
     111    int         i_default_sub_id;   /* As specified in container; if applicable */ 
    111112    char        **ppsz_audio_language; 
    112113    char        **ppsz_sub_language; 
     
    179180    var_Get( p_input, "sub-track", &val ); 
    180181    p_sys->i_sub_last = val.i_int; 
     182 
     183    p_sys->i_default_sub_id   = -1; 
    181184 
    182185    if( !p_input->b_preparsing ) 
     
    11291132                i_wanted  = es->i_channel; 
    11301133            } 
     1134            else if( p_sys->i_default_sub_id >= 0 ) 
     1135            { 
     1136                if( es->i_id == p_sys->i_default_sub_id ) 
     1137                    i_wanted = es->i_channel; 
     1138            } 
     1139 
    11311140            if( p_sys->i_sub_last >= 0 ) 
    11321141                i_wanted  = p_sys->i_sub_last; 
     
    14921501            } 
    14931502            return VLC_SUCCESS; 
     1503             
     1504        case ES_OUT_SET_DEFAULT: 
     1505        { 
     1506            es = (es_out_id_t*) va_arg( args, es_out_id_t * ); 
     1507 
     1508            if( es == NULL ) 
     1509            { 
     1510                /*p_sys->i_default_video_id = -1;*/ 
     1511                /*p_sys->i_default_audio_id = -1;*/ 
     1512                p_sys->i_default_sub_id = -1; 
     1513            } 
     1514            else if( es == (es_out_id_t*)((uint8_t*)NULL+AUDIO_ES) ) 
     1515            { 
     1516                /*p_sys->i_default_video_id = -1;*/ 
     1517            } 
     1518            else if( es == (es_out_id_t*)((uint8_t*)NULL+VIDEO_ES) ) 
     1519            { 
     1520                /*p_sys->i_default_audio_id = -1;*/ 
     1521            } 
     1522            else if( es == (es_out_id_t*)((uint8_t*)NULL+SPU_ES) ) 
     1523            { 
     1524                p_sys->i_default_sub_id = -1; 
     1525            } 
     1526            else 
     1527            { 
     1528                /*if( es->fmt.i_cat == VIDEO_ES ) 
     1529                    p_sys->i_default_video_id = es->i_id; 
     1530                else 
     1531                if( es->fmt.i_cat == AUDIO_ES ) 
     1532                    p_sys->i_default_audio_id = es->i_id; 
     1533                else*/ 
     1534                if( es->fmt.i_cat == SPU_ES ) 
     1535                    p_sys->i_default_sub_id = es->i_id; 
     1536            } 
     1537            return VLC_SUCCESS; 
     1538        } 
    14941539 
    14951540        case ES_OUT_SET_PCR: