Changeset c4d19b859876eee3510940ae172d66d4723ba1a8

Show
Ignore:
Timestamp:
13/10/07 01:41:31 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1192232491 +0000
git-parent:

[8281a1556a25c368985933c44c2cbc3667bd5f62]

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

Added sout-mux-caching option. It allow to set the initial muxer cache value
in millisecond.

Original patch created by Jeff Hansen.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc-module.c

    rd1167c2 rc4d19b8  
    844844    "multiple playlist item (automatically insert the gather stream output " \ 
    845845    "if not specified)" ) 
     846 
     847#define SOUT_MUX_CACHING_TEXT N_("Stream output muxer caching (ms)") 
     848#define SOUT_MUX_CACHING_LONGTEXT N_( \ 
     849    "This allow you to configure the initial caching amount for stream output " \ 
     850    " muxer. This value should be set in milliseconds." ) 
    846851 
    847852#define PACKETIZER_TEXT N_("Preferred packetizer list") 
     
    16871692    add_bool( "sout-spu", 1, NULL, SOUT_SPU_TEXT, 
    16881693                                SOUT_SPU_LONGTEXT, VLC_TRUE ); 
     1694    add_integer( "sout-mux-caching", 1500, NULL, SOUT_MUX_CACHING_TEXT, 
     1695                                SOUT_MUX_CACHING_LONGTEXT, VLC_TRUE ); 
    16891696 
    16901697    set_section( N_("VLM"), NULL ); 
  • src/stream_output/stream_output.c

    r4ff9961 rc4d19b8  
    104104    vlc_object_attach( p_sout, p_parent ); 
    105105 
     106    /* */ 
     107    var_Create( p_sout, "sout-mux-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 
     108 
     109    /* */ 
    106110    p_sout->p_stream = sout_StreamNew( p_sout, p_sout->psz_chain ); 
    107  
    108111    if( p_sout->p_stream == NULL ) 
    109112    { 
     
    471474    { 
    472475        msg_Err( p_mux, "cannot add a new stream (unsupported while muxing " 
    473                         "to this format)" ); 
     476                        "to this format). You can try increasing sout-mux-caching value" ); 
    474477        return NULL; 
    475478    } 
     
    552555    if( p_mux->b_waiting_stream ) 
    553556    { 
     557        const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * I64C(1000); 
     558 
    554559        if( p_mux->i_add_stream_start < 0 ) 
    555         { 
    556560            p_mux->i_add_stream_start = p_buffer->i_dts; 
    557         } 
    558  
    559         if( p_mux->i_add_stream_start >= 0 && 
    560             p_mux->i_add_stream_start + I64C(1500000) < p_buffer->i_dts ) 
    561         { 
    562             /* Wait until we have more than 1.5 seconds worth of data 
    563              * before start muxing */ 
    564             p_mux->b_waiting_stream = VLC_FALSE; 
    565         } 
    566         else 
    567         { 
     561 
     562        /* Wait until we have enought data before muxing */ 
     563        if( p_mux->i_add_stream_start < 0 || 
     564            p_buffer->i_dts < p_mux->i_add_stream_start + i_caching ) 
    568565            return; 
    569         } 
     566        p_mux->b_waiting_stream = VLC_FALSE; 
    570567    } 
    571568    p_mux->pf_mux( p_mux );