From c632c97667ea3ae55ef614c6e23fad7dfb1a61bf Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 23 Feb 2021 13:06:27 +0200 Subject: Audio: Handling unsupported audio There was a crash open the context menu when the audio decoder is missing. --- src/audio/player.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/audio/player.c') diff --git a/src/audio/player.c b/src/audio/player.c index 762cff7a..d2ec9870 100644 --- a/src/audio/player.c +++ b/src/audio/player.c @@ -796,8 +796,10 @@ iString *metadataLabel_Player(const iPlayer *d) { } unlock_Mutex(&d->decoder->tagMutex); } - appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), - SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", - d->spec.freq); + if (d->decoder) { + appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), + SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", + d->spec.freq); + } return meta; } -- cgit v1.2.3