Changeset 45c3c5f4c0d8413799253968f4210cc6f5cc776c

Show
Ignore:
Timestamp:
10/08/08 23:10:28 (4 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1218402628 +0200
git-parent:

[e7d43dd44d9b2de967c8a8097f3eeb7e3d914c2e]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1218402628 +0200
Message:

update: Various fixes to make it work on Mac OS X.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_update.h

    r312324c r45c3c5f  
    6060VLC_EXPORT( void, update_Download, ( update_t *, const char* ) ); 
    6161VLC_EXPORT( update_release_t*, update_GetRelease, ( update_t * ) ); 
     62VLC_EXPORT( void, update_WaitDownload, ( update_t * ) ); 
    6263 
    6364/** 
  • modules/gui/macosx/update.m

    r53aef42 r45c3c5f  
    152152    { 
    153153        /* perform download and pass the selected path */ 
    154         [self performDownload: [sheet filename]]; 
     154        [NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet filename]]; 
    155155    } 
    156156    [sheet release]; 
     
    216216- (void)performDownload:(NSString *)path 
    217217{ 
     218    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
    218219    update_Download( p_u, [path UTF8String] ); 
    219220    [o_btn_DownloadNow setEnabled: NO]; 
    220221    [o_update_window orderOut: self]; 
     222    update_WaitDownload( p_u ); 
    221223    update_Delete( p_u ); 
    222224    p_u = nil; 
     225    [pool release]; 
    223226} 
    224227 
  • src/libvlccore.sym

    r6625284 r45c3c5f  
    363363update_NeedUpgrade 
    364364__update_New 
     365update_WaitDownload 
    365366us_atof 
    366367us_strtod 
  • src/misc/update.c

    re7d43dd r45c3c5f  
    14571457} 
    14581458 
     1459void update_WaitDownload( update_t *p_update ) 
     1460{ 
     1461    if(p_update->p_download) 
     1462        vlc_thread_join( p_update->p_download ); 
     1463    vlc_object_release( p_update->p_download ); 
     1464    p_update->p_download = NULL; 
     1465} 
     1466 
    14591467static void* update_DownloadReal( vlc_object_t *p_this ); 
    14601468 
     
    15051513    char *psz_destdir = p_udt->psz_destdir; 
    15061514 
     1515    msg_Dbg( p_udt, "Opening Stream '%s'", p_update->release.psz_url ); 
     1516 
    15071517    /* Open the stream */ 
    15081518    p_stream = stream_UrlNew( p_udt, p_update->release.psz_url ); 
     
    15371547    p_buffer = (void *)malloc( 1 << 10 ); 
    15381548    if( !p_buffer ) 
     1549    { 
     1550        msg_Err( p_udt, "Can't malloc (1 << 10) bytes! download cancelled." ); 
    15391551        goto end; 
     1552    } 
     1553 
     1554    msg_Dbg( p_udt, "Downloading Stream '%s'", p_update->release.psz_url ); 
    15401555 
    15411556    psz_size = size_str( l_size ); 
     
    15861601        { 
    15871602            intf_ProgressUpdate( p_udt, i_progress, psz_status, 100.0, 0 ); 
     1603            i_progress = 0; 
    15881604            free( psz_status ); 
    15891605        } 
     
    16751691 
    16761692end: 
     1693    if( i_progress ) 
     1694    { 
     1695        intf_ProgressUpdate( p_udt, i_progress, "Cancelled", 100.0, 0 ); 
     1696    } 
    16771697    if( p_stream ) 
    16781698        stream_Delete( p_stream ); 
     
    17161736} 
    17171737 
     1738void update_WaitDownload( update_t *p_update ) 
     1739{ 
     1740    (void)p_update; 
     1741} 
     1742 
    17181743void update_Download( update_t *p_update, const char *psz_destdir ) 
    17191744{