Changeset 47d57d6db23a6bd693dfba2abaec210b1cdb15c3

Show
Ignore:
Timestamp:
20/09/03 15:46:00 (5 years ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1064065560 +0000
git-parent:

[92b1b630f65ead2270fa4557d94f6e326def03ec]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1064065560 +0000
Message:

* modules/gui/macosx/*:

  • implemented the new input variables for control.
  • reevaltuated the locking mechanisms in the osx intf.
    a lot of this can now be removed, because of the new input structures,
    and the vout garbage collector of playlist.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/controls.m

    r53f8728 r47d57d6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002-2003 VideoLAN 
    5  * $Id: controls.m,v 1.47 2003/07/29 21:14:10 gbazin Exp $ 
     5 * $Id: controls.m,v 1.48 2003/09/20 13:46:00 hartman Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
     
    7575{ 
    7676    intf_thread_t * p_intf = [NSApp getIntf]; 
    77  
    7877    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    7978                                                       FIND_ANYWHERE ); 
    80     if( p_playlist == NULL ) 
    81     { 
    82         return; 
    83     } 
    84  
    85     playlist_Stop( p_playlist ); 
    86     vlc_object_release( p_playlist ); 
     79    if( p_playlist != NULL ) 
     80    { 
     81        playlist_Stop( p_playlist ); 
     82        vlc_object_release( p_playlist ); 
     83    } 
    8784} 
    8885 
     
    9087{ 
    9188    intf_thread_t * p_intf = [NSApp getIntf]; 
    92  
    93     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    94                                                        FIND_ANYWHERE ); 
    95     if( p_playlist == NULL ) 
    96     { 
    97         return; 
    98     } 
    99  
    100     vlc_mutex_lock( &p_playlist->object_lock ); 
    101     if( p_playlist->p_input != NULL ) 
    102     { 
    103         input_SetStatus( p_playlist->p_input, INPUT_STATUS_FASTER ); 
    104     }  
    105     vlc_mutex_unlock( &p_playlist->object_lock ); 
    106  
    107     vlc_object_release( p_playlist ); 
     89    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
     90                                                       FIND_ANYWHERE ); 
     91    if( p_input != NULL ) 
     92    { 
     93        vlc_value_t val; val.b_bool = VLC_TRUE; 
     94 
     95        var_Set( p_input, "rate-faster", val ); 
     96        vlc_object_release( p_input ); 
     97    } 
    10898} 
    10999 
     
    111101{ 
    112102    intf_thread_t * p_intf = [NSApp getIntf]; 
    113  
    114     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    115                                                        FIND_ANYWHERE ); 
    116     if( p_playlist == NULL ) 
    117     { 
    118         return; 
    119     } 
    120  
    121     vlc_mutex_lock( &p_playlist->object_lock ); 
    122     if( p_playlist->p_input != NULL ) 
    123     { 
    124         input_SetStatus( p_playlist->p_input, INPUT_STATUS_SLOWER ); 
    125     } 
    126     vlc_mutex_unlock( &p_playlist->object_lock ); 
    127  
    128     vlc_object_release( p_playlist ); 
     103    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
     104                                                       FIND_ANYWHERE ); 
     105    if( p_input != NULL ) 
     106    { 
     107        vlc_value_t val; val.b_bool = VLC_TRUE; 
     108 
     109        var_Set( p_input, "rate-slower", val ); 
     110        vlc_object_release( p_input ); 
     111    } 
    129112} 
    130113 
     
    245228{ 
    246229    intf_thread_t * p_intf = [NSApp getIntf]; 
    247     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    248                                                        FIND_ANYWHERE ); 
    249     if( p_playlist == NULL || p_playlist->p_input == NULL ) 
    250     { 
    251         if ( p_playlist != NULL ) vlc_object_release( p_playlist ); 
    252         return; 
    253     } 
    254  
    255     playlist_Play( p_playlist ); 
    256     input_Seek( p_playlist->p_input, 5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); 
    257     vlc_object_release( p_playlist ); 
     230    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
     231                                                       FIND_ANYWHERE ); 
     232    if( p_input != NULL ) 
     233    { 
     234        vlc_value_t time; 
     235        time.f_float = 5; 
     236        var_Set( p_input, "time-offset", time ); 
     237        vlc_object_release( p_input ); 
     238    } 
    258239} 
    259240 
     
    261242{ 
    262243    intf_thread_t * p_intf = [NSApp getIntf]; 
    263     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    264                                                        FIND_ANYWHERE ); 
    265     if( p_playlist == NULL || p_playlist->p_input == NULL ) 
    266     { 
    267         if ( p_playlist != NULL ) vlc_object_release( p_playlist ); 
    268         return; 
    269     } 
    270  
    271     playlist_Play( p_playlist ); 
    272     input_Seek( p_playlist->p_input, -5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); 
    273     vlc_object_release( p_playlist ); 
     244    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
     245                                                       FIND_ANYWHERE ); 
     246    if( p_input != NULL ) 
     247    { 
     248        vlc_value_t time; 
     249        time.f_float = -5; 
     250        var_Set( p_input, "time-offset", time ); 
     251        vlc_object_release( p_input ); 
     252    } 
    274253} 
    275254 
  • modules/gui/macosx/info.m

    r567eba1 r47d57d6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: info.m,v 1.6 2003/05/25 17:27:13 massiot Exp $ 
     5 * $Id: info.m,v 1.7 2003/09/20 13:46:00 hartman Exp $ 
    66 * 
    77 * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> 
     
    8585 
    8686    intf_thread_t * p_intf = [NSApp getIntf];  
    87     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     87    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
    8888                                                       FIND_ANYWHERE ); 
    8989 
    90     if( p_playlist == NULL ) 
     90    if ( p_input == NULL ) 
    9191    { 
    92         return; 
    93     } 
    94  
    95     vlc_mutex_lock( &p_playlist->object_lock ); 
    96  
    97     if ( p_playlist->p_input == NULL ) 
    98     { 
    99         vlc_mutex_unlock( &p_playlist->object_lock ); 
    100         vlc_object_release( p_playlist ); 
    10192        return; 
    10293    } 
     
    10596    [o_selector removeAllItems]; 
    10697 
    107     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); 
    108     input_info_category_t * p_category = p_playlist->p_input->stream.p_info; 
     98    vlc_mutex_lock( &p_input->stream.stream_lock ); 
     99    input_info_category_t * p_category = p_input->stream.p_info; 
    109100 
    110101    while( p_category ) 
     
    114105    } 
    115106 
    116     vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); 
    117     vlc_mutex_unlock( &p_playlist->object_lock ); 
    118     vlc_object_release( p_playlist ); 
     107    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     108    vlc_object_release( p_input ); 
    119109 
    120110    int i_select = [o_selector indexOfItemWithTitle:o_selectedPane]; 
     
    162152 
    163153    intf_thread_t * p_intf = [NSApp getIntf]; 
    164     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
     154    input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
    165155                                                       FIND_ANYWHERE ); 
    166  
    167     if( p_playlist != NULL ) 
    168     { 
    169         vlc_mutex_lock( &p_playlist->object_lock ); 
    170     } 
    171156 
    172157    if( [[o_mi title] isEqualToString: _NS("Info")] ) 
    173158    { 
    174         if( p_playlist == NULL || p_playlist->p_input == NULL ) 
     159        if( p_input == NULL ) 
    175160        { 
    176161            bEnabled = FALSE; 
    177162        } 
    178     } 
    179      
    180     if( p_playlist != NULL ) 
    181     { 
    182         vlc_mutex_unlock( &p_playlist->object_lock ); 
    183         vlc_object_release( p_playlist ); 
     163        else 
     164        { 
     165            vlc_object_release( p_input ); 
     166        } 
    184167    } 
    185168 
  • modules/gui/macosx/intf.h

    r07d406a r47d57d6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002-2003 VideoLAN 
    5  * $Id: intf.h,v 1.43 2003/09/19 23:03:27 hartman Exp $ 
     5 * $Id: intf.h,v 1.44 2003/09/20 13:46:00 hartman Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
     
    226226 
    227227- (void)manage; 
    228 - (void)manage:(playlist_t *)p_playlist; 
    229 - (void)manageMode:(playlist_t *)p_playlist; 
    230228- (void)manageIntf:(NSTimer *)o_timer; 
    231229- (void)setupMenus; 
  • modules/gui/macosx/intf.m

    r07d406a r47d57d6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002-2003 VideoLAN 
    5  * $Id: intf.m,v 1.94 2003/09/19 23:03:27 hartman Exp $ 
     5 * $Id: intf.m,v 1.95 2003/09/20 13:46:00 hartman Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
     
    484484        { 
    485485            var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); 
    486             vlc_mutex_lock( &p_playlist->object_lock ); 
    487              
    488             [self manage: p_playlist]; 
    489              
    490             vlc_mutex_unlock( &p_playlist->object_lock ); 
     486#define p_input p_playlist->p_input 
     487         
     488            if( p_input ) 
     489            { 
     490                if( !p_input->b_die ) 
     491                { 
     492                    vlc_value_t val; 
     493 
     494                    /* New input or stream map change */ 
     495                    if( p_input->stream.b_changed ) 
     496                    { 
     497                        msg_Dbg( p_intf, "stream has changed, refreshing interface" ); 
     498                        p_intf->p_sys->b_playing = TRUE; 
     499                        p_intf->p_sys->b_current_title_update = 1; 
     500                        p_input->stream.b_changed = 0; 
     501                        p_intf->p_sys->b_intf_update = TRUE; 
     502                    } 
     503 
     504                    if( var_Get( (vlc_object_t *)p_input, "intf-change", &val ) 
     505                        >= 0 && val.b_bool ) 
     506                    { 
     507                        p_intf->p_sys->b_input_update = TRUE; 
     508                    } 
     509                } 
     510            } 
     511            else if( p_intf->p_sys->b_playing && !p_intf->b_die ) 
     512            { 
     513                p_intf->p_sys->b_playing = FALSE; 
     514                p_intf->p_sys->b_intf_update = TRUE; 
     515            } 
     516             
     517#undef p_input 
    491518            vlc_object_release( p_playlist ); 
    492519        } 
     
    499526 
    500527    [self terminate]; 
    501  
    502528    [o_pool release]; 
    503 } 
    504  
    505 - (void)manage:(playlist_t *)p_playlist 
    506 { 
    507     intf_thread_t * p_intf = [NSApp getIntf]; 
    508  
    509 #define p_input p_playlist->p_input 
    510  
    511     if( p_input ) 
    512     { 
    513         vlc_mutex_lock( &p_input->stream.stream_lock ); 
    514  
    515         if( !p_input->b_die ) 
    516         { 
    517             /* New input or stream map change */ 
    518             if( p_input->stream.b_changed ) 
    519             { 
    520                 p_intf->p_sys->b_playing = TRUE; 
    521                 [self manageMode: p_playlist]; 
    522             } 
    523  
    524             vlc_value_t val; 
    525  
    526             if( var_Get( (vlc_object_t *)p_input, "intf-change", &val ) 
    527                 >= 0 && val.b_bool ) 
    528             { 
    529                 p_intf->p_sys->b_input_update = TRUE; 
    530             } 
    531         } 
    532         vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    533     } 
    534     else if( p_intf->p_sys->b_playing && !p_intf->b_die ) 
    535     { 
    536         p_intf->p_sys->b_playing = FALSE; 
    537         [self manageMode: p_playlist]; 
    538     } 
    539  
    540 #undef p_input 
    541 } 
    542  
    543 - (void)manageMode:(playlist_t *)p_playlist 
    544 { 
    545     intf_thread_t * p_intf = [NSApp getIntf]; 
    546  
    547     if( p_playlist->p_input != NULL ) 
    548     { 
    549         p_intf->p_sys->b_current_title_update = 1; 
    550         p_playlist->p_input->stream.b_changed = 0; 
    551          
    552         msg_Dbg( p_intf, "stream has changed, refreshing interface" ); 
    553     } 
    554  
    555     p_intf->p_sys->b_intf_update = VLC_TRUE; 
    556529} 
    557530 
     
    615588        vlc_bool_t b_seekable = VLC_FALSE; 
    616589        vlc_bool_t b_chapters = VLC_FALSE; 
     590        vlc_value_t val; 
    617591 
    618592        b_plmul = p_playlist->i_size > 1; 
     
    630604            /* chapters & titles */ 
    631605            b_chapters = p_input->stream.i_area_nb > 1;  
     606  
     607            vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    632608 
    633609            /* play status */ 
    634             p_intf->p_sys->b_play_status =  
    635                 p_input->stream.control.i_status != PAUSE_S; 
    636              
    637             vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     610            var_Get( p_input, "state", &val ); 
     611            p_intf->p_sys->b_play_status = val.i_int != PAUSE_S; 
    638612        } 
    639613        else 
     
    660634        p_intf->p_sys->b_intf_update = VLC_FALSE; 
    661635    } 
    662      
    663 #define p_area p_input->stream.p_selected_area 
    664636 
    665637    if( p_intf->p_sys->b_playing && p_input != NULL ) 
    666638    { 
    667         vlc_bool_t b_field_update = TRUE; 
    668         vlc_mutex_lock( &p_input->stream.stream_lock ); 
    669          
     639        vlc_value_t time, val; 
     640        NSString * o_time; 
     641        mtime_t i_seconds; 
     642        var_Get( p_input, "state", &val ); 
     643 
    670644        if( !p_input->b_die && ( p_intf->p_sys->b_play_status != 
    671             ( p_input->stream.control.i_status != PAUSE_S ) ) )  
     645            ( val.i_int != PAUSE_S ) ) )  
    672646        { 
    673647            p_intf->p_sys->b_play_status = 
     
    679653        if( p_input->stream.b_seekable ) 
    680654        { 
    681             if( f_slider == f_slider_old ) 
     655            vlc_value_t pos; 
     656            float f_updated; 
     657             
     658            var_Get( p_input, "position", &pos ); 
     659            f_updated = 10000. * pos.f_float; 
     660 
     661            if( f_slider != f_updated ) 
    682662            { 
    683                 float f_updated = ( 10000. * p_area->i_tell ) / 
    684                                            p_area->i_size; 
    685  
    686                 if( f_slider != f_updated ) 
    687                 { 
    688                     [o_timeslider setFloatValue: f_updated]; 
    689                 } 
     663                [o_timeslider setFloatValue: f_updated]; 
    690664            } 
    691             else 
    692             { 
    693                 off_t i_seek = ( f_slider * p_area->i_size ) / 10000; 
    694  
    695                 /* release the lock to be able to seek */ 
    696                 vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    697                 vlc_mutex_unlock( &p_playlist->object_lock ); 
    698                 playlist_Play( p_playlist ); 
    699                 input_Seek( p_input, i_seek, INPUT_SEEK_SET ); 
    700                 vlc_mutex_lock( &p_playlist->object_lock ); 
    701                 vlc_mutex_lock( &p_input->stream.stream_lock ); 
    702  
    703                 /* update the old value */ 
    704                 f_slider_old = f_slider;  
    705  
    706                 b_field_update = VLC_FALSE; 
    707             } 
    708         } 
    709  
    710         if( b_field_update ) 
    711         { 
    712             NSString * o_time; 
    713             char psz_time[ OFFSETTOTIME_MAX_SIZE ]; 
    714  
    715             input_OffsetToTime( p_input, psz_time, p_area->i_tell ); 
    716  
    717             o_time = [NSString stringWithUTF8String: psz_time]; 
    718             [o_timefield setStringValue: o_time]; 
    719         } 
    720         vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     665        } 
     666             
     667        var_Get( p_input, "time", &time ); 
     668        i_seconds = time.i_time / 1000000; 
     669         
     670        o_time = [NSString stringWithFormat: @"%d:%02d:%02d", 
     671                        (int) (i_seconds / (60 * 60)), 
     672                        (int) (i_seconds / 60 % 60), 
     673                        (int) (i_seconds % 60)]; 
     674        [o_timefield setStringValue: o_time]; 
    721675 
    722676        /* disable screen saver */ 
    723677        UpdateSystemActivity( UsrActivity ); 
    724     } 
    725  
    726 #undef p_area 
    727  
    728     if( p_input != NULL ) 
    729     { 
    730         vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    731678    } 
    732679 
     
    929876- (IBAction)timesliderUpdate:(id)sender 
    930877{ 
     878    intf_thread_t * p_intf; 
     879    input_thread_t * p_input; 
    931880    float f_updated; 
    932881 
     
    935884        case NSLeftMouseUp: 
    936885        case NSLeftMouseDown: 
    937             f_slider = [sender floatValue]; 
    938             return; 
    939  
    940886        case NSLeftMouseDragged: 
    941887            f_updated = [sender floatValue]; 
     
    946892    } 
    947893 
    948     intf_thread_t * p_intf = [NSApp getIntf]; 
    949  
    950     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
    951                                                        FIND_ANYWHERE ); 
    952  
    953     if( p_playlist == NULL ) 
    954     { 
    955         return; 
    956     } 
    957  
    958     vlc_mutex_lock( &p_playlist->object_lock ); 
    959  
    960     if( p_playlist->p_input != NULL ) 
    961     { 
    962         off_t i_tell; 
     894    p_intf = [NSApp getIntf]; 
     895    p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, 
     896                                            FIND_ANYWHERE ); 
     897 
     898    if( p_input != NULL ) 
     899    { 
     900        vlc_value_t time; 
     901        mtime_t i_seconds; 
    963902        NSString * o_time; 
    964         char psz_time[ OFFSETTOTIME_MAX_SIZE ]; 
    965  
    966 #define p_area p_playlist->p_input->stream.p_selected_area 
    967         vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); 
    968         i_tell = f_updated / 10000. * p_area->i_size; 
    969         input_OffsetToTime( p_playlist->p_input, psz_time, i_tell ); 
    970         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); 
    971 #undef p_area 
    972  
    973         o_time = [NSString stringWithUTF8String: psz_time]; 
    974         [o_timefield setStringValue: o_time];  
    975     } 
    976  
    977     vlc_mutex_unlock( &p_playlist->object_lock ); 
    978     vlc_object_release( p_playlist ); 
     903 
     904        if( p_input->stream.b_seekable ) 
     905        { 
     906                vlc_value_t pos; 
     907                pos.f_float = f_updated / 10000.; 
     908                if( f_slider != f_updated ) 
     909                { 
     910                    var_Set( p_input, "position", pos ); 
     911                    [o_timeslider setFloatValue: f_updated]; 
     912                } 
     913        } 
     914             
     915        var_Get( p_input, "time", &time ); 
     916        i_seconds = time.i_time / 1000000; 
     917         
     918        o_time = [NSString stringWithFormat: @"%d:%02d:%02d", 
     919                        (int) (i_seconds / (60 * 60)), 
     920                        (int) (i_seconds / 60 % 60), 
     921                        (int) (i_seconds % 60)]; 
     922        [o_timefield setStringValue: o_time]; 
     923        vlc_object_release( p_input ); 
     924    } 
    979925} 
    980926 
     
    982928{ 
    983929    NSEvent * o_event; 
    984     vout_thread_t * p_vout; 
    985930    playlist_t * p_playlist; 
    986931    intf_thread_t * p_intf = [NSApp getIntf]; 
     
    996941        vlc_object_release( p_playlist ); 
    997942        playlist_Destroy( p_playlist ); 
    998     } 
    999  
    1000     /* 
    1001      * Free video outputs 
    1002      */ 
    1003     msg_Dbg( p_intf, "removing all video outputs" ); 
    1004     while( (p_vout = vlc_object_find( p_intf->p_vlc,  
    1005                                       VLC_OBJECT_VOUT, FIND_CHILD )) ) 
    1006     { 
    1007         vlc_object_detach( p_vout ); 
    1008         vlc_object_release( p_vout ); 
    1009         vout_Destroy( p_vout ); 
    1010943    } 
    1011944 
  • modules/gui/macosx/playlist.m

    r07d406a r47d57d6  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002-2003 VideoLAN 
    5  * $Id: playlist.m,v 1.31 2003/09/19 23:03:27 hartman Exp $ 
     5 * $Id: playlist.m,v 1.32 2003/09/20 13:46:00 hartman Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
     
    3333#include "intf.h" 
    3434#include "playlist.h" 
     35#include "controls.h" 
    3536 
    3637int MacVersion102 = -1; 
     
    8182    { 
    8283        case ' ': 
    83             vlc_mutex_lock( &p_playlist->object_lock ); 
    84             if( p_playlist->p_input != NULL ) 
    85             { 
    86                 input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE ); 
    87             } 
    88             vlc_mutex_unlock( &p_playlist->object_lock ); 
     84            [(VLCControls *)[[NSApp delegate] getControls] play: nil]; 
    8985            break; 
    9086 
     
    232228                                                       FIND_ANYWHERE ); 
    233229 
    234     if( p_playlist == NULL ) 
    235     { 
    236         return; 
    237     } 
    238  
    239     playlist_Goto( p_playlist, [o_table_view selectedRow] ); 
    240  
    241     vlc_object_release( p_playlist ); 
     230    if( p_playlist != NULL ) 
     231    { 
     232        playlist_Goto( p_playlist, [o_table_view selectedRow] ); 
     233        vlc_object_release( p_playlist ); 
     234    } 
    242235} 
    243236 
     
    258251     
    259252    o_to_delete = [NSMutableArray arrayWithArray:[[o_table_view selectedRowEnumerator] allObjects]]; 
    260     c = [o_to_delete count]; 
     253    c = (int)[o_to_delete count]; 
    261254     
    262255    for( i = 0; i < c; i++ ) { 
  • modules/gui/macosx/vout.m

    r00a3f0e r47d57d6  
    44 ***************************************************************************** 
    55 * Copyright (C) 2001-2003 VideoLAN 
    6  * $Id: vout.m,v 1.55 2003/08/25 14:51:47 garf Exp $ 
     6 * $Id: vout.m,v 1.56 2003/09/20 13:46:00 hartman Exp $ 
    77 * 
    88 * Authors: Colin Delacroix <colin@zoy.org> 
     
    428428        { 
    429429            vlc_bool_t b_playing = NO; 
    430             playlist_t * p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, 
     430            input_thread_t * p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, 
    431431                                                                    FIND_ANYWHERE ); 
    432432 
    433             if ( p_playlist != nil
     433            if ( p_input != NULL
    434434            { 
    435                 vlc_mutex_lock( &p_playlist->object_lock ); 
    436                 if( p_playlist->p_input != NULL ) 
    437                 { 
    438                     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); 
    439                     b_playing = p_playlist->p_input->stream.control.i_status != PAUSE_S; 
    440                     vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); 
    441                 } 
    442                 vlc_mutex_unlock( &p_playlist->object_lock ); 
    443                 vlc_object_release( p_playlist ); 
     435                vlc_value_t state; 
     436                var_Get( p_input, "state", &state ); 
     437                b_playing = state.i_int != PAUSE_S; 
     438                vlc_object_release( p_input ); 
    444439            } 
    445440            if ( !b_playing ) 
     
    986981- (void)keyDown:(NSEvent *)o_event 
    987982{ 
     983    playlist_t * p_playlist; 
    988984    unichar key = 0; 
    989985    vlc_value_t val; 
     
    10121008 
    10131009        case ' ': 
    1014             input_SetStatus( p_vout, INPUT_STATUS_PAUSE ); 
     1010            p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, 
     1011                                                    FIND_ANYWHERE ); 
     1012            if ( p_playlist != NULL ) 
     1013            { 
     1014                playlist_Pause( p_playlist ); 
     1015                vlc_object_release( p_playlist); 
     1016            } 
    10151017            break; 
    10161018