瀏覽代碼

VLCMedia: improve now playing handling

Felix Paul Kühne 11 年之前
父節點
當前提交
c034a24559
共有 2 個文件被更改,包括 3 次插入6 次删除
  1. 2 0
      NEWS
  2. 1 6
      Sources/VLCMedia.m

+ 2 - 0
NEWS

@@ -30,6 +30,8 @@ New APIs:
 Modified API behavior:
 - VLCMediaPlayer:
   - implementing mediaPlayerTimeChanged is now optional
+- VLCMedia:
+  - nowPlaying meta information is correctly handled now
 
 Deprecated APIs:
 - VLCMedia:

+ 1 - 6
Sources/VLCMedia.m

@@ -112,12 +112,6 @@ static inline VLCMediaState LibVLCStateToMediaState( libvlc_state_t state )
  */
 static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
 {
-    if (event->u.media_meta_changed.meta_type == libvlc_meta_Publisher ||
-        event->u.media_meta_changed.meta_type == libvlc_meta_NowPlaying) {
-        /* Skip those meta. We don't really care about them for now.
-         * And they occure a lot */
-        return;
-    }
     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
     [[VLCEventManager sharedManager] callOnMainThreadObject:self
                                                  withMethod:@selector(metaChanged:)
@@ -957,6 +951,7 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
         [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationDate];
         [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationGenre];
         [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTrackNumber];
+        [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationNowPlaying];
     }
     if (!isArtURLFetched) {
         isArtURLFetched = YES;