diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 13:06:27 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 13:06:27 +0200 |
commit | c632c97667ea3ae55ef614c6e23fad7dfb1a61bf (patch) | |
tree | 3375e50d9d43bd08cca627c50e4275852724062b | |
parent | c3bad1a8f5b606d5ae52f6ae554a907ae6dfa437 (diff) |
Audio: Handling unsupported audio
There was a crash open the context menu when the audio decoder is missing.
-rw-r--r-- | src/audio/player.c | 8 |
1 files changed, 5 insertions, 3 deletions
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) { | |||
796 | } | 796 | } |
797 | unlock_Mutex(&d->decoder->tagMutex); | 797 | unlock_Mutex(&d->decoder->tagMutex); |
798 | } | 798 | } |
799 | appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), | 799 | if (d->decoder) { |
800 | SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", | 800 | appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), |
801 | d->spec.freq); | 801 | SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", |
802 | d->spec.freq); | ||
803 | } | ||
802 | return meta; | 804 | return meta; |
803 | } | 805 | } |