VLCKit(4.0.0a5) Crashing on iOS/tvOS
This is what is getting reported by crashlytics, i am not able to reproduce this on my side, it seems the RTSP streams are with audio and causing the app to crash.
Fatal Exception: NSInvalidArgumentException
*** -[AVSampleBufferAudioRenderer enqueueSampleBuffer:] invalid parameter not satisfying: sampleBuffer != NULL
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x83f20 __exceptionPreprocess
1 libobjc.A.dylib 0x16018 objc_exception_throw
2 AVFCore 0xe5ff0 -[AVSampleBufferAudioRenderer flush]
3 VLCKit 0x46a98 -[VLCAVSample whenDataReady] + 256 (avsamplebuffer.m:256)
4 VLCKit 0x46e80 __25-[VLCAVSample play:date:]_block_invoke + 270 (avsamplebuffer.m:270)
5 AVFCore 0xee8cc -[AVMediaDataRequester _requestMediaDataIfReady]
6 libdispatch.dylib 0x213c _dispatch_call_block_and_release
7 libdispatch.dylib 0x3dd4 _dispatch_client_callout
8 libdispatch.dylib 0xb400 _dispatch_lane_serial_drain
9 libdispatch.dylib 0xbf30 _dispatch_lane_invoke
10 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh
11 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread
12 libsystem_pthread.dylib 0x4934 _pthread_wqthread
13 libsystem_pthread.dylib 0x10cc start_wqthread
These are the logs from VLCKit
[vlc][debug]: VLC media player - 4.0.0-dev Otto Chriek
[vlc][debug]: Copyright © 1996-2024 the VideoLAN team
[vlc][debug]: revision 4.0.0-dev-29229-g919c93246d
[vlc][debug]: configured with /Users/fkuehne/videolan/gits/VLCKit/libvlc/vlc/configure '--host=aarch64-apple-darwin' '--build=aarch64-apple-darwin23.5.0' '--prefix=/Users/fkuehne/videolan/gits/VLCKit/libvlc/vlc/build-iphoneos-arm64/vlc-iphoneos17.4-arm64' '--with-contrib=/Users/fkuehne/videolan/gits/VLCKit/libvlc/vlc/contrib/arm64-iphoneos17.4' '--disable-sse' '--disable-mmx' '--disable-a52' '--disable-vcd' '--disable-libcddb' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-lua' '--disable-qt' '--disable-skins2' '--disable-vlc' '--disable-vlm' '--disable-nls' '--disable-notify' '--disable-projectm' '--disable-goom' '--disable-dvdread' '--disable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-libva' '--disable-gme' '--disable-tremor' '--disable-fluidsynth' '--disable-jack' '--disable-pulse' '--disable-mtp' '--disable-screen' '--disable-sparkle' '--disable-addonmanagermodules' '--disable-mad' '--disable-shared' '--enable-static' 'CFLAGS=-mios-version-min=9.0 -arch arm64 -isysroot /Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -g' 'OBJCFLAGS=-mios-version-min=9.0 -arch arm64 -isysroot /Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -g' 'CXXFLAGS=-mios-version-min=9.0 -arch arm64 -isysroot /Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -g' 'ac_cv_func_basename_r=no' 'ac_cv_func_clock_getres=no' 'ac_cv_func_clock_gettime=no' 'ac_cv_func_clock_settime=no' 'ac_cv_func_dirname_r=no' 'ac_cv_func_getentropy=no' 'ac_cv_func_mkostemp=no' 'ac_cv_func_mkostemps=no' 'ac_cv_func_timingsafe_bcmp=no' 'ac_cv_func_open_wmemstream=no' 'ac_cv_func_fmemopen=no' 'ac_cv_func_open_memstream=no' 'ac_cv_func_futimens=no' 'ac_cv_func_utimensat=no' 'ac_cv_func_thread_get_register_pointer_values=no' 'ac_cv_func_aligned_alloc=no' 'ac_cv_func_timespec_get=no' 'build_alias=aarch64-apple-darwin23.5.0' 'host_alias=aarch64-apple-darwin' 'CC=/Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'LDFLAGS=-Wl,-platform_version,ios,9.0,17.4 -mios-version-min=9.0 -arch arm64 ' 'CPPFLAGS=-arch arm64 -isysroot /Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk' 'CPP=/Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E' 'CXX=/Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++' 'OBJC=/Applications/Xcode-13.4.1-fixed.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'PKG_CONFIG_LIBDIR='
[vlc][debug]: creating audio output
[vlc][debug]: looking for audio output module matching "any": 2 candidates
[vlc][debug]: using audio output module "avsamplebuffer"
[vlc][debug]: keeping audio output
[vlc][debug]: Creating an input for 'rtsp://192.168.100.197:554/'
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateOpening
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: using timeshift granularity of 50 MiB
[vlc][debug]: using default timeshift path
[vlc][debug]: `rtsp://192.168.100.197:554/?real_stream' gives access `rtsp' demux `any' path `192.168.100.197:554/?real_stream'
[vlc][debug]: creating access: rtsp://192.168.100.197:554/?real_stream
[vlc][debug]: looking for access module matching "rtsp": 2 candidates
[vlc][debug]: version 2016.10.21
[vlc][debug]: RTP subsession 'video/H264'
[vlc][debug]: selecting program id=0
[vlc][debug]: ES track added: 'video/auto/0' (fourcc: 'h264')
[vlc][debug]: RTP subsession 'audio/PCMA'
[vlc][debug]: ES track added: 'audio/auto/1' (fourcc: 'alaw')
[vlc][debug]: setup start: 0.000000 stop:0.000000
[vlc][debug]: We have a timeout of 60 seconds
[vlc][debug]: play start: 0.000000 stop:0.000000
[vlc][debug]: using access module "live555"
[vlc][debug]: looking for packetizer module matching "any": 25 candidates
[vlc][debug]: found NAL_SPS (id=0)
[vlc][debug]: found NAL_PPS (id=0)
[vlc][debug]: using packetizer module "h264"
[vlc][debug]: looking for video decoder module matching "any": 12 candidates
[vlc][debug]: vout: none found
[vlc][error]: cannot add callback 0x1091e48fc to nonexistent variable 'fit'
[vlc][debug]: looking for text renderer module matching "freetype": 2 candidates
[vlc][debug]: using text renderer module "freetype"
[vlc][debug]: looking for video converter module matching "any": 15 candidates
[vlc][debug]: 32x32 (32x32) chroma: YUVA colorspace: Undefined -> 16x16 (16x16) chroma: RGBA colorspace: Undefined with scaling using Bicubic (good quality)
[vlc][debug]: using video converter module "swscale"
[vlc][debug]: looking for video converter module matching "any": 15 candidates
[vlc][debug]: YUVP to YUVA converter
[vlc][debug]: using video converter module "yuvp"
[vlc][debug]: Deinterlacing available
[vlc][debug]: deinterlace -1, mode auto, is_needed 0
[vlc][debug]: looking for vout window module matching "any": 2 candidates
[vlc][debug]: resized to 390x844
[vlc][debug]: using vout window module "uiview_window"
[vlc][debug]: looking for inhibit module matching "any": 1 candidates
[vlc][debug]: using inhibit module "uikit_inhibit"
[vlc][debug]: looking for decoder device module matching "any": 1 candidates
[vlc][debug]: using decoder device module "videotoolbox"
[vlc][debug]: new SPS parsed: 0
[vlc][debug]: new PPS parsed: 0
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][info]: Using Video Toolbox to decode 'h264'
[vlc][debug]: using video decoder module "videotoolbox"
[vlc][debug]: ES track selected: 'video/auto/0' (fourcc: 'h264')
[vlc][debug]: looking for audio decoder module matching "any": 14 candidates
[vlc][debug]: samplerate:8000Hz channels:1
[vlc][debug]: using audio decoder module "g711"
[vlc][debug]: ES track selected: 'audio/auto/1' (fourcc: 'alaw')
[vlc][debug]: looking for meta reader module matching "any": 1 candidates
[vlc][debug]: no meta reader modules matched with name any
[vlc][debug]: `rtsp://192.168.100.197:554/?real_stream' successfully opened
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStatePlaying
[vlc][debug]: The input can't pace, selecting the input (PCR) as the clock source
[vlc][debug]: reusing audio output
[vlc][debug]: program(0): using clock source: 'input'
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Buffering 0%
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Buffering 2%
[vlc][warning]: setPreferredOutputNumberOfChannels failed (0)
[vlc][debug]: Output on Default, channel count: 1
[vlc][debug]: VLC keeping the same input layout
[vlc][debug]: output 'f32l' 8000 Hz Mono frame=1 samples/4 bytes
[vlc][debug]: looking for audio volume module matching "any": 2 candidates
[vlc][debug]: using audio volume module "float_mixer"
[vlc][debug]: input 's16l' 8000 Hz Mono frame=1 samples/2 bytes
[vlc][debug]: looking for audio filter module matching "scaletempo": 1 candidates
[vlc][debug]: format: 8000 rate, 1 nch, 4 bps, fl32
[vlc][debug]: params: 30 stride, 0.200 overlap, 14 search
[vlc][debug]: 1.000 scale, 240.000 stride_in, 240 stride_out, 192 standing, 48 overlap, 112 search, 400 queue, fl32 mode
[vlc][debug]: using audio filter module "scaletempo"
[vlc][debug]: conversion: 's16l'->'f32l' 8000 Hz->8000 Hz Mono->Mono
[vlc][debug]: looking for audio converter module matching "any": 8 candidates
[vlc][debug]: s16l->f32l, bits per sample: 16->32
[vlc][debug]: using audio converter module "audio_format"
[vlc][debug]: conversion pipeline complete
[vlc][debug]: conversion: 'f32l'->'f32l' 8000 Hz->8000 Hz Mono->Mono
[vlc][debug]: conversion pipeline complete
[vlc][debug]: looking for audio resampler module matching "soxr": 2 candidates
[vlc][debug]: Using SoX Resampler with 'cr32s' engine and 'Medium 16-bit with medium roll-off' quality to convert f32l/8000Hz to f32l/8000Hz.
[vlc][debug]: using audio resampler module "soxr"
[vlc][debug]: restarting module due to input format change
[vlc][debug]: 'decoder in/packetizer out' profile -1 / 77
[vlc][debug]: 'decoder in/packetizer out' i_width 0 / 1920
[vlc][debug]: 'decoder in/packetizer out' i_height 0 / 1088
[vlc][debug]: 'decoder in/packetizer out' i_visible_width 0 / 1920
[vlc][debug]: 'decoder in/packetizer out' i_visible_height 0 / 1080
[vlc][debug]: removing "video decoder" module "videotoolbox"
[vlc][debug]: looking for video decoder module matching "any": 12 candidates
[vlc][debug]: vout change: decoder size
[vlc][debug]: vout change: visible size
[vlc][debug]: new SPS parsed: 0
[vlc][debug]: new PPS parsed: 0
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][info]: Using Video Toolbox to decode 'h264'
[vlc][debug]: using video decoder module "videotoolbox"
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Stream buffering done (1001 ms in 1443 ms)
[vlc][debug]: session accepted first frame 1719962427369026
[vlc][error]: buffer deadlock prevented
[vlc][debug]: Decoder wait done in 7 ms
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][debug]: vout change: chroma
[vlc][debug]: requested window size: 1920x1080
[vlc][debug]: deinterlace -1, mode auto, is_needed 0
[vlc][debug]: Opening vout display wrapper
[vlc][debug]: looking for vout display module matching "any": 2 candidates
[vlc][debug]: using vout display module "samplebufferdisplay"
[vlc][debug]: original format sz 1920x1088, of (0,0), vsz 1920x1080, 4cc CVPN, sar 1:1, orient: normal
[vlc][debug]: removing "text renderer" module "freetype"
[vlc][debug]: looking for text renderer module matching "freetype": 2 candidates
[vlc][debug]: using text renderer module "freetype"
[vlc][debug]: requested window size: 1920x1080
[vlc][debug]: control type=25
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: discarding non recovery frame 1719962428285692
[vlc][debug]: session accepted first frame 1719962428369025
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: resetting master clock: coefficient too unstable: 1.326941
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: discarding non recovery frame 1719962429202357
[vlc][debug]: discarding non recovery frame 1719962429285690
[vlc][warning]: playback too late (87614): up-sampling
[vlc][debug]: session accepted first frame 1719962429369023
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: resetting master clock: coefficient too unstable: 3.107100
[vlc][warning]: playback way too early (-135588): playing silence
[vlc][debug]: inserting 1084 zeroes / 135ms
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: resetting master clock: coefficient too unstable: 2.620726
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: playback too early (-113026): down-sampling
[vlc][warning]: playback way too early (-133024): playing silence
[vlc][debug]: inserting 1064 zeroes / 133ms
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: discarding non recovery frame 1719962430119022
[vlc][debug]: discarding non recovery frame 1719962430202355
[vlc][debug]: discarding non recovery frame 1719962430285688
[vlc][debug]: session accepted first frame 1719962430369021
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: playback way too early (-1731017): playing silence
[vlc][debug]: inserting 13848 zeroes / 1731ms
[vlc][warning]: picture is too late to be displayed (missing 1686 ms)
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: session accepted first frame 1719962433369020
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: playback way too early (-1736406): playing silence
[vlc][debug]: inserting 13891 zeroes / 1736ms
[vlc][warning]: playback too late (62535): up-sampling
[vlc][warning]: picture is too late to be displayed (missing 1454 ms)
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: playback way too early (-352035): playing silence
[vlc][debug]: inserting 2816 zeroes / 352ms
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: session accepted first frame 1719962436369019
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: playback too late (120407): up-sampling
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: session accepted first frame 1719962437369018
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: vt session error: 'kVTVideoDecoderBadDataErr'
[vlc][warning]: restarting vt session (dec callback failed)
[vlc][warning]: forcing output chroma (kCVPixelFormatType): 420v
[vlc][debug]: discarding non recovery frame 1719962438119017
[vlc][warning]: resetting master clock: coefficient too unstable: 0.225769
[vlc][debug]: discarding non recovery frame 1719962438202350
[vlc][debug]: discarding non recovery frame 1719962438285683
[vlc][error]: ES_OUT_SET_(GROUP_)PCR is called 561 ms late (pts_delay increased to 1000 ms)
[vlc][debug]: ES_OUT_RESET_PCR called
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: session accepted first frame 1719962438369016
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Buffering 0%
[vlc][debug]: output chroma (kCVPixelFormatType): 420v
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Buffering 100%
[vlc][debug]: Received first picture
[vlc][debug]: resized to 1170x2532
Optional(<VLCMediaPlayer: 0x3021ec4b0>) state changed to: VLCMediaPlayerStateBuffering
[vlc][debug]: Stream buffering done (1500 ms in 1101 ms)
[vlc][error]: buffer deadlock prevented
[vlc][debug]: Decoder wait done in 7 ms
[vlc][error]: CMBlockBufferRef creation failure -12704