kirtan-shah / nowplaying-cli

macOS command-line utility for retrieving currently playing media
GNU General Public License v3.0
167 stars 10 forks source link

Getting `elapsedTime` aborts the program #12

Open moehmeni opened 1 year ago

moehmeni commented 1 year ago

I got this when I ran get elapsedTime. running on macOS Catalina 10.15.7

2023-09-12 23:04:15.881 get_media_v1[48718:1804921] -[MRContentItem initWithNowPlayingInfo:]: unrecognized selector sent to instance 0x7fd43044dbe0
2023-09-12 23:04:15.882 get_media_v1[48718:1804921] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MRContentItem initWithNowPlayingInfo:]: unrecognized selector sent to instance 0x7fd43044dbe0'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff36d1ddd7 __exceptionPreprocess + 250
        1   libobjc.A.dylib                     0x00007fff6f77e5bf objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff36d9cf07 -[NSObject(NSObject) __retain_OA] + 0
        3   CoreFoundation                      0x00007fff36c8262b ___forwarding___ + 1427
        4   CoreFoundation                      0x00007fff36c82008 _CF_forwarding_prep_0 + 120
        5   get_media_v1                        0x000000010d7a28f6 __main_block_invoke + 550
        6   MediaRemote                         0x00007fff5d0a0967 __MRMediaRemoteGetNowPlayingInfoForOrigin_block_invoke + 87
        7   MediaRemote                         0x00007fff5d0a073b __MRMediaRemoteGetNowPlayingInfoForPlayer_block_invoke + 75
        8   MediaRemote                         0x00007fff5d0a337b ___MRGetNowPlayingInfo_block_invoke_2 + 59
        9   libdispatch.dylib                   0x00007fff708cc6c4 _dispatch_call_block_and_release + 12
        10  libdispatch.dylib                   0x00007fff708cd658 _dispatch_client_callout + 8
        11  libdispatch.dylib                   0x00007fff708cf4b0 _dispatch_queue_override_invoke + 763
        12  libdispatch.dylib                   0x00007fff708db957 _dispatch_root_queue_drain + 326
        13  libdispatch.dylib                   0x00007fff708dc097 _dispatch_worker_thread2 + 92
        14  libsystem_pthread.dylib             0x00007fff70b279f7 _pthread_wqthread + 220
        15  libsystem_pthread.dylib             0x00007fff70b26b77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException

But it shows the elapsedTime in get-raw:

kMRMediaRemoteNowPlayingInfoElapsedTime = "49.983051";
diemer commented 1 year ago

i don't see that in the latest release on Ventura 13.2.1, though I'm unsure how useful elapsed time even is. It continues to increment when a track is paused, but resets to the track time when playing.

moehmeni commented 1 year ago

@diemer It shows the current playback time of the song. I need it for a sync functionality.

nyxaria commented 11 months ago

@diemer only for some applications