Changeset 347c0fec445debf826f6194aca3fec9aeddd6db0

Show
Ignore:
Timestamp:
07/24/02 17:21:47 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1027524107 +0000
git-parent:

[bd0431f64f0b1f41777f5eb4aaad5cf575a6858c]

git-author:
Sam Hocevar <sam@videolan.org> 1027524107 +0000
Message:
  • ./plugins/mpeg_system/mpeg_es.c: fixed a segfault when no decoder was
    found (p_fifo might be NULL).
  • ./plugins/mpeg_system/mpeg_es.c, ./src/input/input_ext-dec.c: fixed
    a deadlock issue with demuxers waiting on p_fifo->data_lock.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/mpeg_system/mpeg_es.c

    r64d33dc r347c0fe  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: mpeg_es.c,v 1.10 2002/07/23 00:39:17 sam Exp $ 
     5 * $Id: mpeg_es.c,v 1.11 2002/07/24 15:21:47 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    173173    pes_packet_t *  p_pes; 
    174174    data_packet_t * p_data; 
    175     
     175 
     176    if( p_fifo == NULL ) 
     177    { 
     178        return -1; 
     179    } 
     180 
    176181    i_read = input_SplitBuffer( p_input, &p_data, ES_PACKET_SIZE ); 
    177182 
    178183    if ( i_read <= 0 ) 
    179184    { 
    180         return( i_read )
     185        return i_read
    181186    } 
    182187 
     
    187192        msg_Err( p_input, "out of memory" ); 
    188193        input_DeletePacket( p_input->p_method_data, p_data ); 
    189         return( -1 )
     194        return -1
    190195    } 
    191196 
     
    195200 
    196201    vlc_mutex_lock( &p_fifo->data_lock ); 
     202 
     203    /* If the decoder is waiting for us, wake him up */ 
     204    vlc_cond_signal( &p_fifo->data_wait ); 
     205 
    197206    if( p_fifo->i_depth >= MAX_PACKETS_IN_FIFO ) 
    198207    { 
     
    214223    input_DecodePES( p_fifo, p_pes ); 
    215224 
    216     return( 1 )
    217 } 
    218  
     225    return 1
     226} 
     227 
  • src/input/input_ext-dec.c

    r9e3ab28 r347c0fe  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: input_ext-dec.c,v 1.32 2002/06/01 12:32:01 sam Exp $ 
     5 * $Id: input_ext-dec.c,v 1.33 2002/07/24 15:21:47 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    9999        p_fifo->p_first = NULL; 
    100100        p_fifo->pp_last = &p_fifo->p_first; 
     101 
     102        /* If the input is waiting for us, tell him to stop */ 
     103        vlc_cond_signal( &p_fifo->data_wait ); 
    101104 
    102105        /* Waiting for the input thread to put new PES packets in the fifo */