Changeset c7c447ce6ff25ceb722bfa60184e4eaa0c02708f

Show
Ignore:
Timestamp:
06/09/07 19:59:36 (1 year ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1189101576 +0000
git-parent:

[f77ac5c87be84dcf2a19c4324b59e12ccba6b9f7]

git-author:
Jean-Baptiste Kempf <jb@videolan.org> 1189101576 +0000
Message:

Qt4 - Optimization of mrl generator. Only needed things are generated.
patch by Jean-François Massol

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/dialogs/sout.cpp

    rf29d7df rc7c447c  
    9090 
    9191//     /* Connect everything to the updateMRL function */ 
    92  #define CB( x ) CONNECT( ui.x, clicked( bool ), this, updateMRL() ); 
     92 #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); 
    9393 #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() ); 
    9494 #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); 
     
    130130} 
    131131 
     132QString SoutDialog::getMrl() 
     133{ 
     134    return this->mrl; 
     135} 
     136 
    132137void SoutDialog::fileBrowse() 
    133138{ 
     
    257262    sout_gui_descr_t sout; 
    258263    memset( &sout, 0, sizeof( sout_gui_descr_t ) ); 
     264    int counter = 0; 
    259265 
    260266    sout.b_local = ui.localOutput->isChecked(); 
     
    282288    sout.psz_name = strdup( qtu( ui.sapName->text() ) ); 
    283289 
     290#define COUNT() \ 
     291{ \ 
     292    if ( sout.b_local ) \ 
     293        counter += 1; \ 
     294    if ( sout.b_file ) \ 
     295        counter += 1; \ 
     296    if ( sout.b_http ) \ 
     297        counter += 1; \ 
     298    if ( sout.b_mms ) \ 
     299        counter += 1; \ 
     300    if ( sout.b_udp ) \ 
     301        counter += 1; \ 
     302} 
     303 
     304COUNT() 
     305 
    284306#define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt ); 
    285307    SMUX( PSMux, "ps" ); 
     
    341363#define ISMORE() if ( more ) mrl.append( "," ); 
    342364 
    343         if ( trans ) 
    344         { 
    345             mrl.append( ":duplicate{" ); 
    346         } 
    347         else 
     365#define ATLEASTONE() \ 
     366        if ( counter > 1 ) \ 
     367        { \ 
     368            mrl.append( "dst=" ); \ 
     369        } 
     370 
     371    if ( trans ) 
     372    { 
     373        mrl.append( ":" ); 
     374    } 
     375    else 
    348376        { 
    349377            mrl = ":sout=#"; 
    350378        } 
    351379 
     380        if ( counter > 1 ) 
     381        { 
     382            mrl.append( "duplicate{" ); 
     383        } 
     384 
    352385        if ( sout.b_local ) 
    353386        { 
    354387            ISMORE(); 
    355             mrl.append( "dst=display" ); 
     388            ATLEASTONE() 
     389            mrl.append( "display" ); 
    356390            more = true; 
    357391        } 
     
    360394        { 
    361395            ISMORE(); 
    362             mrl.append( "dst=std{access=file,mux=" ); 
     396        ATLEASTONE() 
     397            mrl.append( "std{access=file,mux=" ); 
    363398            mrl.append( sout.psz_mux ); 
    364399            mrl.append( ",dst=" ); 
     
    371406        { 
    372407            ISMORE(); 
    373             mrl.append( "dst=std{access=http,mux=" ); 
     408            ATLEASTONE() 
     409            mrl.append( "std{access=http,mux=" ); 
    374410            mrl.append( sout.psz_mux ); 
    375411            mrl.append( ",dst=" ); 
     
    384420        { 
    385421            ISMORE(); 
    386             mrl.append( "dst=std{access=mmsh,mux=" ); 
     422            ATLEASTONE() 
     423            mrl.append( "std{access=mmsh,mux=" ); 
    387424            mrl.append( sout.psz_mux ); 
    388425            mrl.append( ",dst=" ); 
     
    397434        { 
    398435            ISMORE(); 
    399             mrl.append( "dst=std{access=udp,mux=" ); 
     436            ATLEASTONE() 
     437            mrl.append( "std{access=udp,mux=" ); 
    400438            mrl.append( sout.psz_mux ); 
    401439            mrl.append( ",dst=" ); 
     
    417455        } 
    418456 
    419         if ( trans
     457        if ( counter > 1
    420458        { 
    421459            mrl.append( "}" ); 
  • modules/gui/qt4/dialogs/sout.hpp

    r21dd718 rc7c447c  
    4444    virtual ~SoutDialog() {} 
    4545 
     46    QString getMrl(); 
    4647    QString mrl; 
    4748    //sout_gui_descr_t *sout; 
  • modules/gui/qt4/dialogs_provider.cpp

    re4bbf1c rc7c447c  
    401401        int i_len = strlen( qtu(s->mrl) ) + 10; 
    402402        char *psz_option = (char*)malloc(i_len); 
    403         snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl)); 
     403        snprintf( psz_option, i_len - 1, "%s", qtu(s->mrl)); 
    404404 
    405405        playlist_AddExt( THEPL, qtu( mrl ), "Streaming",