Commit 581c9952 authored by David Fuhrmann's avatar David Fuhrmann

macosx: info panel: remove unneeded autorelease pool

parent 2588397b
...@@ -176,91 +176,88 @@ ...@@ -176,91 +176,88 @@
- (void)updatePanelWithItem:(input_item_t *)_p_item; - (void)updatePanelWithItem:(input_item_t *)_p_item;
{ {
@autoreleasepool { if (_p_item != p_item) {
if (p_item)
if (_p_item != p_item) { vlc_gc_decref(p_item);
if (p_item) [_saveMetaDataButton setEnabled: NO];
vlc_gc_decref(p_item); if (_p_item)
[_saveMetaDataButton setEnabled: NO]; vlc_gc_incref(_p_item);
if (_p_item) p_item = _p_item;
vlc_gc_incref(_p_item); }
p_item = _p_item;
}
if (!p_item) { if (!p_item) {
/* Erase */ /* Erase */
#define SET( foo ) \ #define SET( foo ) \
[_##foo##TextField setStringValue:@""]; [_##foo##TextField setStringValue:@""];
SET( uri ); SET( uri );
SET( title ); SET( title );
SET( author ); SET( author );
SET( collection ); SET( collection );
SET( seqNum ); SET( seqNum );
SET( genre ); SET( genre );
SET( copyright ); SET( copyright );
SET( publisher ); SET( publisher );
SET( nowPlaying ); SET( nowPlaying );
SET( language ); SET( language );
SET( date ); SET( date );
SET( description ); SET( description );
SET( encodedby ); SET( encodedby );
#undef SET #undef SET
[_imageWell setImage: [NSImage imageNamed: @"noart.png"]]; [_imageWell setImage: [NSImage imageNamed: @"noart.png"]];
} else { } else {
if (!input_item_IsPreparsed(p_item)) if (!input_item_IsPreparsed(p_item))
libvlc_MetaRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE); libvlc_MetaRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
/* fill uri info */ /* fill uri info */
char *psz_url = vlc_uri_decode(input_item_GetURI(p_item)); char *psz_url = vlc_uri_decode(input_item_GetURI(p_item));
[_uriTextField setStringValue:toNSStr(psz_url)]; [_uriTextField setStringValue:toNSStr(psz_url)];
free(psz_url); free(psz_url);
/* fill title info */ /* fill title info */
char *psz_title = input_item_GetTitle(p_item); char *psz_title = input_item_GetTitle(p_item);
if (!psz_title) if (!psz_title)
psz_title = input_item_GetName(p_item); psz_title = input_item_GetName(p_item);
[_titleTextField setStringValue:toNSStr(psz_title)]; [_titleTextField setStringValue:toNSStr(psz_title)];
free(psz_title); free(psz_title);
#define SET( foo, bar ) \ #define SET( foo, bar ) \
char *psz_##foo = input_item_Get##bar ( p_item ); \ char *psz_##foo = input_item_Get##bar ( p_item ); \
[_##foo##TextField setStringValue:toNSStr(psz_##foo)]; \ [_##foo##TextField setStringValue:toNSStr(psz_##foo)]; \
FREENULL( psz_##foo ); FREENULL( psz_##foo );
/* fill the other fields */ /* fill the other fields */
SET( author, Artist ); SET( author, Artist );
SET( collection, Album ); SET( collection, Album );
SET( seqNum, TrackNum ); SET( seqNum, TrackNum );
SET( genre, Genre ); SET( genre, Genre );
SET( copyright, Copyright ); SET( copyright, Copyright );
SET( publisher, Publisher ); SET( publisher, Publisher );
SET( nowPlaying, NowPlaying ); SET( nowPlaying, NowPlaying );
SET( language, Language ); SET( language, Language );
SET( date, Date ); SET( date, Date );
SET( description, Description ); SET( description, Description );
SET( encodedby, EncodedBy ); SET( encodedby, EncodedBy );
#undef SET #undef SET
char *psz_meta; char *psz_meta;
NSImage *image; NSImage *image;
psz_meta = input_item_GetArtURL(p_item); psz_meta = input_item_GetArtURL(p_item);
/* FIXME Can also be attachment:// */ /* FIXME Can also be attachment:// */
if (psz_meta && strncmp(psz_meta, "attachment://", 13)) if (psz_meta && strncmp(psz_meta, "attachment://", 13))
image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:toNSStr(psz_meta)]]; image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:toNSStr(psz_meta)]];
else else
image = [NSImage imageNamed: @"noart.png"]; image = [NSImage imageNamed: @"noart.png"];
[_imageWell setImage: image]; [_imageWell setImage: image];
FREENULL(psz_meta); FREENULL(psz_meta);
} }
/* reload the codec details table */ /* reload the codec details table */
[self updateStreamsList]; [self updateStreamsList];
/* update the stats once to display p_item change faster */ /* update the stats once to display p_item change faster */
[self updateStatistics]; [self updateStatistics];
}
} }
- (void)updateStatistics - (void)updateStatistics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment