Changeset 0069e74976a75ee075a901f4632b3a4239a48388

Show
Ignore:
Timestamp:
07/09/08 22:50:54 (3 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1220820654 +0200
git-parent:

[8d0e42edea792212cca0098d8e247d134bb6e424]

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

The msleep in stream.c is useless as access MUST wait themselves.

At worst it will use a lot of CPU but this will allow to detect buggy
access/access_demux module.

Files:

Legend:

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

    r9f9f4cf r0069e74  
    7777 *  We release blocks once the total size is bigger than CACHE_BLOCK_SIZE 
    7878 */ 
    79 #define STREAM_DATA_WAIT 40000       /* Time between before a pf_block retry */ 
    8079 
    8180/* Method2: A bit more complex, for pf_read 
     
    864863        if( ( b = AReadBlock( s, &b_eof ) ) == NULL ) 
    865864        { 
    866             if( b_eof ) break; 
    867  
    868             msleep( STREAM_DATA_WAIT ); 
     865            if( b_eof ) 
     866                break; 
    869867            continue; 
    870868        } 
     
    12021200        bool b_eof; 
    12031201 
    1204         if( s->b_die ) return VLC_EGENERIC; 
    1205  
     1202        if( s->b_die ) 
     1203            return VLC_EGENERIC; 
    12061204 
    12071205        /* Fetch a block */ 
    1208         if( ( b = AReadBlock( s, &b_eof ) ) ) break; 
    1209  
    1210         if( b_eof ) return VLC_EGENERIC; 
    1211  
    1212         msleep( STREAM_DATA_WAIT ); 
     1206        if( ( b = AReadBlock( s, &b_eof ) ) ) 
     1207            break; 
     1208        if( b_eof ) 
     1209            return VLC_EGENERIC; 
    12131210    } 
    12141211 
     
    15641561        if( i_read <  0 ) 
    15651562        { 
    1566             msleep( STREAM_DATA_WAIT ); 
    15671563            continue; 
    15681564        } 
    15691565        else if( i_read == 0 ) 
    15701566        { 
    1571             if( !b_read ) return VLC_EGENERIC; 
     1567            if( !b_read ) 
     1568                return VLC_EGENERIC; 
    15721569            return VLC_SUCCESS; 
    15731570        } 
     
    16431640        i_read = AReadStream( s, &tk->p_buffer[tk->i_end], i_read ); 
    16441641        if( i_read <  0 ) 
    1645         { 
    1646             msleep( STREAM_DATA_WAIT ); 
    16471642            continue; 
    1648         } 
    16491643        else if( i_read == 0 ) 
    1650         { 
    1651             /* EOF */ 
    1652             break; 
    1653         } 
     1644            break;  /* EOF */ 
    16541645 
    16551646        if( i_first == 0 )