[vlc-commits] macosx: info panel: remove unneeded autorelease pool
David Fuhrmann
git at videolan.org
Sat Jan 2 22:36:47 CET 2016
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Jan 2 22:11:18 2016 +0100| [581c99526dd7880ea825f6b1262dd6a73b0fc915] | committer: David Fuhrmann
macosx: info panel: remove unneeded autorelease pool
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=581c99526dd7880ea825f6b1262dd6a73b0fc915
---
modules/gui/macosx/VLCPlaylistInfo.m | 161 +++++++++++++++++-----------------
1 file changed, 79 insertions(+), 82 deletions(-)
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index 337c742..0032e54 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -176,91 +176,88 @@
- (void)updatePanelWithItem:(input_item_t *)_p_item;
{
- @autoreleasepool {
-
- if (_p_item != p_item) {
- if (p_item)
- vlc_gc_decref(p_item);
- [_saveMetaDataButton setEnabled: NO];
- if (_p_item)
- vlc_gc_incref(_p_item);
- p_item = _p_item;
- }
+ if (_p_item != p_item) {
+ if (p_item)
+ vlc_gc_decref(p_item);
+ [_saveMetaDataButton setEnabled: NO];
+ if (_p_item)
+ vlc_gc_incref(_p_item);
+ p_item = _p_item;
+ }
- if (!p_item) {
- /* Erase */
- #define SET( foo ) \
- [_##foo##TextField setStringValue:@""];
- SET( uri );
- SET( title );
- SET( author );
- SET( collection );
- SET( seqNum );
- SET( genre );
- SET( copyright );
- SET( publisher );
- SET( nowPlaying );
- SET( language );
- SET( date );
- SET( description );
- SET( encodedby );
- #undef SET
- [_imageWell setImage: [NSImage imageNamed: @"noart.png"]];
- } else {
- if (!input_item_IsPreparsed(p_item))
- libvlc_MetaRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
-
- /* fill uri info */
- char *psz_url = vlc_uri_decode(input_item_GetURI(p_item));
- [_uriTextField setStringValue:toNSStr(psz_url)];
- free(psz_url);
-
- /* fill title info */
- char *psz_title = input_item_GetTitle(p_item);
- if (!psz_title)
- psz_title = input_item_GetName(p_item);
- [_titleTextField setStringValue:toNSStr(psz_title)];
- free(psz_title);
-
- #define SET( foo, bar ) \
- char *psz_##foo = input_item_Get##bar ( p_item ); \
- [_##foo##TextField setStringValue:toNSStr(psz_##foo)]; \
- FREENULL( psz_##foo );
-
- /* fill the other fields */
- SET( author, Artist );
- SET( collection, Album );
- SET( seqNum, TrackNum );
- SET( genre, Genre );
- SET( copyright, Copyright );
- SET( publisher, Publisher );
- SET( nowPlaying, NowPlaying );
- SET( language, Language );
- SET( date, Date );
- SET( description, Description );
- SET( encodedby, EncodedBy );
-
- #undef SET
-
- char *psz_meta;
- NSImage *image;
- psz_meta = input_item_GetArtURL(p_item);
-
- /* FIXME Can also be attachment:// */
- if (psz_meta && strncmp(psz_meta, "attachment://", 13))
- image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:toNSStr(psz_meta)]];
- else
- image = [NSImage imageNamed: @"noart.png"];
- [_imageWell setImage: image];
- FREENULL(psz_meta);
- }
+ if (!p_item) {
+ /* Erase */
+#define SET( foo ) \
+[_##foo##TextField setStringValue:@""];
+ SET( uri );
+ SET( title );
+ SET( author );
+ SET( collection );
+ SET( seqNum );
+ SET( genre );
+ SET( copyright );
+ SET( publisher );
+ SET( nowPlaying );
+ SET( language );
+ SET( date );
+ SET( description );
+ SET( encodedby );
+#undef SET
+ [_imageWell setImage: [NSImage imageNamed: @"noart.png"]];
+ } else {
+ if (!input_item_IsPreparsed(p_item))
+ libvlc_MetaRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
+
+ /* fill uri info */
+ char *psz_url = vlc_uri_decode(input_item_GetURI(p_item));
+ [_uriTextField setStringValue:toNSStr(psz_url)];
+ free(psz_url);
+
+ /* fill title info */
+ char *psz_title = input_item_GetTitle(p_item);
+ if (!psz_title)
+ psz_title = input_item_GetName(p_item);
+ [_titleTextField setStringValue:toNSStr(psz_title)];
+ free(psz_title);
+
+#define SET( foo, bar ) \
+char *psz_##foo = input_item_Get##bar ( p_item ); \
+[_##foo##TextField setStringValue:toNSStr(psz_##foo)]; \
+FREENULL( psz_##foo );
+
+ /* fill the other fields */
+ SET( author, Artist );
+ SET( collection, Album );
+ SET( seqNum, TrackNum );
+ SET( genre, Genre );
+ SET( copyright, Copyright );
+ SET( publisher, Publisher );
+ SET( nowPlaying, NowPlaying );
+ SET( language, Language );
+ SET( date, Date );
+ SET( description, Description );
+ SET( encodedby, EncodedBy );
+
+#undef SET
+
+ char *psz_meta;
+ NSImage *image;
+ psz_meta = input_item_GetArtURL(p_item);
+
+ /* FIXME Can also be attachment:// */
+ if (psz_meta && strncmp(psz_meta, "attachment://", 13))
+ image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:toNSStr(psz_meta)]];
+ else
+ image = [NSImage imageNamed: @"noart.png"];
+ [_imageWell setImage: image];
+ FREENULL(psz_meta);
+ }
- /* reload the codec details table */
- [self updateStreamsList];
+ /* reload the codec details table */
+ [self updateStreamsList];
- /* update the stats once to display p_item change faster */
- [self updateStatistics];
- }
+ /* update the stats once to display p_item change faster */
+ [self updateStatistics];
}
- (void)updateStatistics
More information about the vlc-commits
mailing list