Changeset 45c3c5f4c0d8413799253968f4210cc6f5cc776c
- 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
| r312324c |
r45c3c5f |
|
| 60 | 60 | VLC_EXPORT( void, update_Download, ( update_t *, const char* ) ); |
|---|
| 61 | 61 | VLC_EXPORT( update_release_t*, update_GetRelease, ( update_t * ) ); |
|---|
| | 62 | VLC_EXPORT( void, update_WaitDownload, ( update_t * ) ); |
|---|
| 62 | 63 | |
|---|
| 63 | 64 | /** |
|---|
| r53aef42 |
r45c3c5f |
|
| 152 | 152 | { |
|---|
| 153 | 153 | /* perform download and pass the selected path */ |
|---|
| 154 | | [self performDownload: [sheet filename]]; |
|---|
| | 154 | [NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet filename]]; |
|---|
| 155 | 155 | } |
|---|
| 156 | 156 | [sheet release]; |
|---|
| … | … | |
| 216 | 216 | - (void)performDownload:(NSString *)path |
|---|
| 217 | 217 | { |
|---|
| | 218 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
|---|
| 218 | 219 | update_Download( p_u, [path UTF8String] ); |
|---|
| 219 | 220 | [o_btn_DownloadNow setEnabled: NO]; |
|---|
| 220 | 221 | [o_update_window orderOut: self]; |
|---|
| | 222 | update_WaitDownload( p_u ); |
|---|
| 221 | 223 | update_Delete( p_u ); |
|---|
| 222 | 224 | p_u = nil; |
|---|
| | 225 | [pool release]; |
|---|
| 223 | 226 | } |
|---|
| 224 | 227 | |
|---|
| r6625284 |
r45c3c5f |
|
| 363 | 363 | update_NeedUpgrade |
|---|
| 364 | 364 | __update_New |
|---|
| | 365 | update_WaitDownload |
|---|
| 365 | 366 | us_atof |
|---|
| 366 | 367 | us_strtod |
|---|
| re7d43dd |
r45c3c5f |
|
| 1457 | 1457 | } |
|---|
| 1458 | 1458 | |
|---|
| | 1459 | void 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 | |
|---|
| 1459 | 1467 | static void* update_DownloadReal( vlc_object_t *p_this ); |
|---|
| 1460 | 1468 | |
|---|
| … | … | |
| 1505 | 1513 | char *psz_destdir = p_udt->psz_destdir; |
|---|
| 1506 | 1514 | |
|---|
| | 1515 | msg_Dbg( p_udt, "Opening Stream '%s'", p_update->release.psz_url ); |
|---|
| | 1516 | |
|---|
| 1507 | 1517 | /* Open the stream */ |
|---|
| 1508 | 1518 | p_stream = stream_UrlNew( p_udt, p_update->release.psz_url ); |
|---|
| … | … | |
| 1537 | 1547 | p_buffer = (void *)malloc( 1 << 10 ); |
|---|
| 1538 | 1548 | if( !p_buffer ) |
|---|
| | 1549 | { |
|---|
| | 1550 | msg_Err( p_udt, "Can't malloc (1 << 10) bytes! download cancelled." ); |
|---|
| 1539 | 1551 | goto end; |
|---|
| | 1552 | } |
|---|
| | 1553 | |
|---|
| | 1554 | msg_Dbg( p_udt, "Downloading Stream '%s'", p_update->release.psz_url ); |
|---|
| 1540 | 1555 | |
|---|
| 1541 | 1556 | psz_size = size_str( l_size ); |
|---|
| … | … | |
| 1586 | 1601 | { |
|---|
| 1587 | 1602 | intf_ProgressUpdate( p_udt, i_progress, psz_status, 100.0, 0 ); |
|---|
| | 1603 | i_progress = 0; |
|---|
| 1588 | 1604 | free( psz_status ); |
|---|
| 1589 | 1605 | } |
|---|
| … | … | |
| 1675 | 1691 | |
|---|
| 1676 | 1692 | end: |
|---|
| | 1693 | if( i_progress ) |
|---|
| | 1694 | { |
|---|
| | 1695 | intf_ProgressUpdate( p_udt, i_progress, "Cancelled", 100.0, 0 ); |
|---|
| | 1696 | } |
|---|
| 1677 | 1697 | if( p_stream ) |
|---|
| 1678 | 1698 | stream_Delete( p_stream ); |
|---|
| … | … | |
| 1716 | 1736 | } |
|---|
| 1717 | 1737 | |
|---|
| | 1738 | void update_WaitDownload( update_t *p_update ) |
|---|
| | 1739 | { |
|---|
| | 1740 | (void)p_update; |
|---|
| | 1741 | } |
|---|
| | 1742 | |
|---|
| 1718 | 1743 | void update_Download( update_t *p_update, const char *psz_destdir ) |
|---|
| 1719 | 1744 | { |
|---|