Show
Ignore:
Timestamp:
28/08/08 14:30:02 (4 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1219926602 +0200
git-parent:

[f259d0a2ac6d4162fdb5b78ac3fdac5acdac1363]

git-author:
Laurent Aimar <fenrir@videolan.org> 1219926602 +0200
Message:

Added a INPUT_CONTROL_RESTART_ES and use it in video_output.

This removes the need for suxor_thread_t.

Files:

Legend:

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

    r0e5207a r1b02555  
    17701770 
    17711771        case ES_OUT_SET_ES: 
     1772        case ES_OUT_RESTART_ES: 
     1773        { 
     1774            int i_cat; 
     1775 
    17721776            es = (es_out_id_t*) va_arg( args, es_out_id_t * ); 
    1773             /* Special case NULL, NULL+i_cat */ 
     1777 
    17741778            if( es == NULL ) 
    1775             { 
    1776                 for( i = 0; i < p_sys->i_es; i++ ) 
    1777                 { 
    1778                     if( EsIsSelected( p_sys->es[i] ) ) 
    1779                         EsUnselect( out, p_sys->es[i], 
    1780                                     p_sys->es[i]->p_pgrm == p_sys->p_pgrm ); 
    1781                 } 
    1782             } 
     1779                i_cat = UNKNOWN_ES; 
    17831780            else if( es == (es_out_id_t*)((uint8_t*)NULL+AUDIO_ES) ) 
    1784             { 
    1785                 for( i = 0; i < p_sys->i_es; i++ ) 
    1786                 { 
    1787                     if( p_sys->es[i]->fmt.i_cat == AUDIO_ES && 
    1788                         EsIsSelected( p_sys->es[i] ) ) 
    1789                         EsUnselect( out, p_sys->es[i], 
    1790                                     p_sys->es[i]->p_pgrm == p_sys->p_pgrm ); 
    1791                 } 
    1792             } 
     1781                i_cat = AUDIO_ES; 
    17931782            else if( es == (es_out_id_t*)((uint8_t*)NULL+VIDEO_ES) ) 
    1794             { 
    1795                 for( i = 0; i < p_sys->i_es; i++ ) 
    1796                 { 
    1797                     if( p_sys->es[i]->fmt.i_cat == VIDEO_ES && 
    1798                         EsIsSelected( p_sys->es[i] ) ) 
    1799                         EsUnselect( out, p_sys->es[i], 
    1800                                     p_sys->es[i]->p_pgrm == p_sys->p_pgrm ); 
    1801                 } 
    1802             } 
     1783                i_cat = VIDEO_ES; 
    18031784            else if( es == (es_out_id_t*)((uint8_t*)NULL+SPU_ES) ) 
    1804             { 
    1805                 for( i = 0; i < p_sys->i_es; i++ ) 
    1806                 { 
    1807                     if( p_sys->es[i]->fmt.i_cat == SPU_ES && 
    1808                         EsIsSelected( p_sys->es[i] ) ) 
    1809                         EsUnselect( out, p_sys->es[i], 
    1810                                     p_sys->es[i]->p_pgrm == p_sys->p_pgrm ); 
    1811                 } 
    1812             } 
     1785                i_cat = SPU_ES; 
    18131786            else 
    1814             { 
    1815                 for( i = 0; i < p_sys->i_es; i++ ) 
     1787                i_cat = -1; 
     1788 
     1789            for( i = 0; i < p_sys->i_es; i++ ) 
     1790            { 
     1791                if( i_cat == -1 ) 
    18161792                { 
    18171793                    if( es == p_sys->es[i] ) 
     
    18211797                    } 
    18221798                } 
    1823             } 
     1799                else 
     1800                { 
     1801                    if( i_cat == UNKNOWN_ES || p_sys->es[i]->fmt.i_cat == i_cat ) 
     1802                    { 
     1803                        if( EsIsSelected( p_sys->es[i] ) ) 
     1804                        { 
     1805                            if( i_query == ES_OUT_RESTART_ES ) 
     1806                            { 
     1807                                if( p_sys->es[i]->p_dec ) 
     1808                                { 
     1809                                    EsDestroyDecoder( out, p_sys->es[i] ); 
     1810                                    EsCreateDecoder( out, p_sys->es[i] ); 
     1811                                } 
     1812                            } 
     1813                            else 
     1814                            { 
     1815                                EsUnselect( out, p_sys->es[i], 
     1816                                            p_sys->es[i]->p_pgrm == p_sys->p_pgrm ); 
     1817                            } 
     1818                        } 
     1819                    } 
     1820                } 
     1821            } 
     1822            if( i_query == ES_OUT_SET_ES ) 
    18241823            { 
    18251824                vlc_event_t event; 
     
    18281827            } 
    18291828            return VLC_SUCCESS; 
     1829        } 
    18301830  
    18311831        case ES_OUT_SET_DEFAULT: