Changeset 21196f47028a9b59d9f882b6abc8f05bb79a34df

Show
Ignore:
Timestamp:
23/01/03 14:44:21 (6 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1043329461 +0000
git-parent:

[e8ce66c232c2cd62cd8d9535200033a0c210f3e9]

git-author:
Laurent Aimar <fenrir@videolan.org> 1043329461 +0000
Message:
  • don't send audio in fast/slow playing speed unless there isn't any video

stream.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/avi/avi.c

    r9a5b0b8 r21196f4  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: avi.c,v 1.27 2003/01/20 13:01:53 fenrir Exp $ 
     5 * $Id: avi.c,v 1.28 2003/01/23 13:44:21 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    684684                                           demux_sys_t *p_avi ) 
    685685{ 
    686     int i_stream; 
     686    int unsigned i_stream; 
    687687    int b_end; 
    688688 
     
    16901690    unsigned int i_stream; 
    16911691    vlc_bool_t b_stream; 
    1692  
     1692    vlc_bool_t b_play_audio; 
     1693    vlc_bool_t b_video; /* is there some video track selected */ 
    16931694    // cannot be more than 100 stream (dcXX or wbXX) 
    16941695    avi_stream_toread_t toread[100]; 
     
    16971698 
    16981699    /* detect new selected/unselected streams */ 
    1699     for( i_stream = 0,i_stream_count= 0
     1700    for( i_stream = 0,i_stream_count= 0, b_video = VLC_FALSE
    17001701            i_stream < p_avi->i_streams; i_stream++ ) 
    17011702    { 
     
    17181719        { 
    17191720            i_stream_count++; 
     1721            if( p_stream->i_cat == VIDEO_ES ) 
     1722            { 
     1723                b_video = VLC_TRUE; 
     1724            } 
    17201725        } 
    17211726#undef  p_stream 
     
    17711776    } 
    17721777#endif 
     1778 
     1779    /* *** send audio data to decoder if rate == DEFAULT_RATE or no video *** */ 
     1780    vlc_mutex_lock( &p_input->stream.stream_lock ); 
     1781    if( p_input->stream.control.i_rate == DEFAULT_RATE || !b_video ) 
     1782    { 
     1783        b_play_audio = VLC_TRUE; 
     1784    } 
     1785    else 
     1786    { 
     1787        b_play_audio = VLC_FALSE; 
     1788    } 
     1789    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     1790 
    17731791    /* init toread */ 
    17741792    for( i_stream = 0; i_stream < p_avi->i_streams; i_stream++ ) 
     
    17781796 
    17791797        toread[i_stream].b_ok = p_stream->b_activated; 
    1780  
    17811798        if( p_stream->i_idxposc < p_stream->i_idxnb ) 
    17821799        { 
     
    20292046        b_stream = VLC_TRUE; // at least one read succeed 
    20302047 
    2031         if( p_stream->p_es && p_stream->p_es->p_decoder_fifo ) 
     2048        if( p_stream->p_es && p_stream->p_es->p_decoder_fifo && 
     2049            ( b_play_audio || p_stream->i_cat != AUDIO_ES ) ) 
    20322050        { 
    20332051            p_pes->i_dts =