SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

SRGTimeSlider throws an exception #127

Closed pyby closed 1 year ago

pyby commented 1 year ago

Issue type

Crash

Description of the problem

In some cases, an on demand content seems to not have yet a maximum value. SRGTimeSliderFormatter(NSTimeInterval seconds) method throws an exception.

SRGTimeSliderFormatter
once.h
SIGABRT: Invalid parameter not satisfying: isfinite(timeInterval) && !isnan(timeInterval)

CoreFoundation   __exceptionPreprocess
libobjc.A.dylib  objc_exception_throw
Foundation       -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
Foundation       -[NSDateComponentsFormatter stringFromTimeInterval:]
Play RSI         SRGTimeSliderFormatter once.h:0
Play RSI         -[SRGTimeSlider updateTimeRangeLabelsWithTime:] SRGTimeSlider~ios.m:356
Play RSI         -[SRGTimeSlider updateDisplayWithTime:] SRGTimeSlider~ios.m:265
Play RSI         -[SRGTimeSlider setMediaPlayerController:] SRGTimeSlider~ios.m:128
Play RSI         -[SRGPeriodicTimeObserver startObservers] SRGPeriodicTimeObserver.m:115
Play RSI         -[SRGPeriodicTimeObserver startObservers] SRGPeriodicTimeObserver.m:131
Play RSI         -[_MAKVONotificationHelper observeValueForKeyPath:ofObject:change:context:] MAKVONotificationCenter.m:146
Foundation       -[NSKeyValueObservance observeValueForKeyPath:ofObject:change:context:]

Environment information

Reproducibility

Difficult to reproduce

Code sample

[SRGTimeSlider updateTimeRangeLabelsWithTime:] SRGTimeSlider~ios.m:356

Replace interval with 0.0/0.0 and play a VoD or an AoD with custom player.

Crash logs from Play SRG Apple apps:

Play RSI 3.7.1: https://appcenter.ms/orgs/RTS-Organization/apps/Play-RSI-1/crashes/errors/1306846231u/overview Play RTS 3.7.1: https://appcenter.ms/orgs/RTS-Organization/apps/Play-RTS-1/crashes/errors/1306846231u/overview Play SRF 3.7.1: https://appcenter.ms/orgs/RTS-Organization/apps/Play-SRF-1/crashes/errors/1306846231u/overview