Changeset b73f6722b19f7e553f7516d7533eeed6074b6ea3

Show
Ignore:
Timestamp:
06/02/02 13:59:46 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1023019186 +0000
git-parent:

[1de74b8731b3bfbd0c76eb67a7e4348a1fa3087c]

git-author:
Sam Hocevar <sam@videolan.org> 1023019186 +0000
Message:

(new in MAIN)

  • ./src/playlist/playlist.c, src/input/input.c: added safety checks to
    prevent crashes on next file.

(ported from 0_4_1_branch)

  • ./plugins/gtk/gtk_display.c, ./plugins/win32/mainframe.cpp: we deactivate
    popup menus when no stream is being played, even in network mode.
  • ./src/input/mpeg_system.c: removed unnecessarily verbose message.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r211d6ba rb73f672  
    55HEAD 
    66 
     7  * ./src/playlist/playlist.c, src/input/input.c: added safety checks to 
     8    prevent crashes on next file. 
    79  * ./src/misc/objects.c: commented all functions. 
    810  * ./src/misc/objects.c: implemented vlc_object_find( , , FIND_ANYWHERE). 
     
    3133 
    32340.4.1 
    33  
     35Not released yet 
     36 
     37  * ./plugins/gtk/gtk_display.c, ./plugins/win32/mainframe.cpp: we deactivate 
     38    popup menus when no stream is being played, even in network mode. 
     39  * ./src/input/mpeg_system.c: removed unnecessarily verbose message. 
    3440  * ./src/video_output/video_output.c: fixed the "picture has invalid status" 
    3541    bug which might have been the cause of crashes. 
  • include/input_ext-intf.h

    r71ec135 rb73f672  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: input_ext-intf.h,v 1.68 2002/06/01 18:04:48 sam Exp $ 
     7 * $Id: input_ext-intf.h,v 1.69 2002/06/02 11:59:46 sam Exp $ 
    88 * 
    99 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    248248    VLC_COMMON_MEMBERS 
    249249 
    250     /* Thread properties and locks */ 
     250    /* Thread properties */ 
    251251    vlc_bool_t              b_eof; 
    252     int                     i_status;                         /* status flag */ 
    253252 
    254253    /* Access module */ 
     
    329328input_thread_t * __input_CreateThread ( vlc_object_t *, 
    330329                                        playlist_item_t *, int * ); 
    331 void   input_StopThread     ( input_thread_t *, int *pi_status ); 
     330void   input_StopThread     ( input_thread_t * ); 
    332331void   input_DestroyThread  ( input_thread_t * ); 
    333332 
  • plugins/gtk/gtk_display.c

    r211d6ba rb73f672  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: gtk_display.c,v 1.24 2002/06/02 09:03:54 sam Exp $ 
     5 * $Id: gtk_display.c,v 1.25 2002/06/02 11:59:46 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    202202            gtk_label_set_text( GTK_LABEL( p_label ), "" ); 
    203203            gtk_widget_show( GTK_WIDGET( p_file_box ) ); 
    204  
    205             /* unsensitize menus */ 
    206             gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"), 
    207                     FALSE ); 
    208             gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE ); 
    209             gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"), 
    210                                       FALSE ); 
    211             gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE ); 
    212             gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"), 
    213                                       FALSE ); 
    214             gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"), 
    215                                       FALSE ); 
    216             gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE ); 
    217             gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"), 
    218                                       FALSE ); 
    219         } 
     204        } 
     205 
     206        /* unsensitize menus */ 
     207        gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"), 
     208                                  FALSE ); 
     209        gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE ); 
     210        gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"), 
     211                                  FALSE ); 
     212        gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE ); 
     213        gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"), 
     214                                  FALSE ); 
     215        gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"), 
     216                                  FALSE ); 
     217        gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE ); 
     218        gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"), 
     219                                  FALSE ); 
    220220    } 
    221221 
  • plugins/win32/mainframe.cpp

    r71ec135 rb73f672  
    668668             * nothing is displayed; isn't it nicer ? :) */  
    669669            i_Height += 17; 
    670  
    671             /* unsensitize menus */ 
    672             MenuProgram->Enabled = false; 
    673             MenuTitle->Enabled = false; 
    674             MenuChapter->Enabled = false; 
    675             MenuAudio->Enabled = false; 
    676             MenuSubtitles->Enabled = false; 
    677             PopupNavigation->Enabled = false; 
    678             PopupAudio->Enabled = false; 
    679             PopupSubtitles->Enabled = false; 
    680670        } 
     671 
     672        /* unsensitize menus */ 
     673        MenuProgram->Enabled = false; 
     674        MenuTitle->Enabled = false; 
     675        MenuChapter->Enabled = false; 
     676        MenuAudio->Enabled = false; 
     677        MenuSubtitles->Enabled = false; 
     678        PopupNavigation->Enabled = false; 
     679        PopupAudio->Enabled = false; 
     680        PopupSubtitles->Enabled = false; 
    681681    } 
    682682 
  • src/input/input.c

    r71ec135 rb73f672  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2001 VideoLAN 
    7  * $Id: input.c,v 1.199 2002/06/01 18:04:49 sam Exp $ 
     7 * $Id: input.c,v 1.200 2002/06/02 11:59:46 sam Exp $ 
    88 * 
    99 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    5858static void ErrorThread     ( input_thread_t *p_input ); 
    5959static void CloseThread     ( input_thread_t *p_input ); 
    60 static void DestroyThread   ( input_thread_t *p_input ); 
    6160static void EndThread       ( input_thread_t *p_input ); 
    6261 
     
    8786    /* Set target */ 
    8887    p_input->psz_source = strdup( p_item->psz_name ); 
    89  
    90     /* Set status */ 
    91     p_input->i_status   = THREAD_CREATE; 
    9288 
    9389    /* Demux */ 
     
    157153    vlc_object_attach( p_input, p_parent ); 
    158154 
    159     /* Create thread. */ 
     155    /* Create thread and wait for its readiness. */ 
    160156    if( vlc_thread_create( p_input, "input", RunThread, 1 ) ) 
    161157    { 
     
    165161    } 
    166162 
    167 #if 0 
    168     /* If status is NULL, wait until the thread is created */ 
    169     if( pi_status == NULL ) 
    170     { 
    171         do 
    172         { 
    173             msleep( THREAD_SLEEP ); 
    174         } while( (i_status != THREAD_READY) && (i_status != THREAD_ERROR) 
    175                 && (i_status != THREAD_FATAL) ); 
    176     } 
    177 #endif 
    178  
    179163    return p_input; 
    180164} 
     
    185169 * This function should not return until the thread is effectively cancelled. 
    186170 *****************************************************************************/ 
    187 void input_StopThread( input_thread_t *p_input, int *pi_status
     171void input_StopThread( input_thread_t *p_input
    188172{ 
    189173    /* Make the thread exit from a possible vlc_cond_wait() */ 
     
    194178    vlc_cond_signal( &p_input->stream.stream_wait ); 
    195179    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    196  
    197     /* If status is NULL, wait until thread has been destroyed */ 
    198 #if 0 
    199     if( pi_status == NULL ) 
    200     { 
    201         do 
    202         { 
    203             msleep( THREAD_SLEEP ); 
    204         } while ( (i_status != THREAD_OVER) && (i_status != THREAD_ERROR) 
    205                   && (i_status != THREAD_FATAL) ); 
    206     } 
    207 #endif 
    208180} 
    209181 
     
    222194    vlc_cond_destroy( &p_input->stream.stream_wait ); 
    223195    vlc_mutex_destroy( &p_input->stream.stream_lock ); 
    224      
    225     /* Free input structure */ 
    226     free( p_input ); 
    227196} 
    228197 
     
    237206    { 
    238207        /* If we failed, wait before we are killed, and exit */ 
    239         p_input->i_status = THREAD_ERROR; 
    240208        p_input->b_error = 1; 
    241209        vlc_thread_ready( p_input ); 
    242210        ErrorThread( p_input ); 
    243         DestroyThread( p_input ); 
    244211        return 0; 
    245212    } 
    246213 
    247214    vlc_thread_ready( p_input ); 
    248  
    249     p_input->i_status = THREAD_READY; 
    250215 
    251216    /* initialization is complete */ 
     
    393358 
    394359    EndThread( p_input ); 
    395  
    396     DestroyThread( p_input ); 
    397360 
    398361    return 0; 
     
    584547    input_DumpStream( p_input ); 
    585548 
    586     /* Store status */ 
    587     p_input->i_status = THREAD_END
     549    /* Tell we're dead */ 
     550    p_input->b_dead = 1
    588551 
    589552    /* Free all ES and destroy all decoder threads */ 
     
    611574} 
    612575 
    613 /***************************************************************************** 
    614  * DestroyThread: destroy the input thread 
    615  *****************************************************************************/ 
    616 static void DestroyThread( input_thread_t * p_input ) 
    617 { 
    618     /* Update status */ 
    619     p_input->i_status = THREAD_OVER; 
    620 } 
    621  
  • src/input/mpeg_system.c

    r9e3ab28 rb73f672  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: mpeg_system.c,v 1.98 2002/06/01 12:32:01 sam Exp $ 
     5 * $Id: mpeg_system.c,v 1.99 2002/06/02 11:59:46 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    12271227                 * (except PCR that have already been handled), we can trash 
    12281228                 * the packet. */ 
    1229                 msg_Warn( p_input, 
    1230                           "packet without payload received by TS demux" ); 
    12311229                b_trash = 1; 
    12321230            } 
  • src/playlist/playlist.c

    r211d6ba rb73f672  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: playlist.c,v 1.3 2002/06/02 09:03:54 sam Exp $ 
     5 * $Id: playlist.c,v 1.4 2002/06/02 11:59:46 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    159159 * playlist_Command: do a playlist action 
    160160 ***************************************************************************** 
    161  * Delete the item in the playlist with position i_pos. 
     161 *  
    162162 *****************************************************************************/ 
    163163void playlist_Command( playlist_t * p_playlist, int i_command, int i_arg ) 
     
    200200        if( p_playlist->p_input ) 
    201201        { 
    202             if( p_playlist->p_input->i_status == THREAD_OVER
     202            if( p_playlist->p_input->b_dead
    203203            { 
    204204                input_thread_t *p_input; 
     
    214214                vlc_object_release( p_input ); 
    215215                input_DestroyThread( p_input ); 
    216             } 
    217             else if(    ( p_playlist->p_input->i_status == THREAD_READY 
    218                            || p_playlist->p_input->i_status == THREAD_ERROR ) 
    219                      && ( p_playlist->p_input->b_error 
    220                            || p_playlist->p_input->b_eof ) ) 
    221             { 
    222                 input_StopThread( p_playlist->p_input, NULL ); 
     216                vlc_object_destroy( p_input ); 
     217            } 
     218            else if( p_playlist->p_input->b_error 
     219                      || p_playlist->p_input->b_eof ) 
     220            { 
     221                input_StopThread( p_playlist->p_input ); 
    223222            } 
    224223        } 
     
    258257    while( p_playlist->p_input ) 
    259258    { 
    260         if( p_playlist->p_input->i_status == THREAD_OVER
     259        if( p_playlist->p_input->b_dead
    261260        { 
    262261            input_thread_t *p_input; 
     
    272271            vlc_object_release( p_input ); 
    273272            input_DestroyThread( p_input ); 
    274         } 
    275         else if(    ( p_playlist->p_input->i_status == THREAD_READY 
    276                        || p_playlist->p_input->i_status == THREAD_ERROR ) 
    277                  && ( p_playlist->p_input->b_error 
    278                        || p_playlist->p_input->b_eof ) ) 
    279         { 
    280             input_StopThread( p_playlist->p_input, NULL ); 
     273            vlc_object_destroy( p_input ); 
     274        } 
     275        else if( p_playlist->p_input->b_error || p_playlist->p_input->b_eof ) 
     276        { 
     277            input_StopThread( p_playlist->p_input ); 
    281278        } 
    282279        else