From feb75686e0dfe37fa1357b108152dad9da901304 Mon Sep 17 00:00:00 2001 From: waker Date: Fri, 9 Nov 2012 21:48:44 +0100 Subject: fixed %Z title formatting crash --- playlist.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'playlist.c') diff --git a/playlist.c b/playlist.c index fb4cce37..424a5b49 100644 --- a/playlist.c +++ b/playlist.c @@ -3043,12 +3043,14 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, } else if (*fmt == 'Z') { DB_fileinfo_t *c = deadbeef->streamer_get_current_fileinfo (); // FIXME: might crash streamer - if (c->fmt.channels <= 2) { - meta = c->fmt.channels == 1 ? _("Mono") : _("Stereo"); - } - else { - snprintf (tmp, sizeof (tmp), "%dch Multichannel", c->fmt.channels); - meta = tmp; + if (c) { + if (c->fmt.channels <= 2) { + meta = c->fmt.channels == 1 ? _("Mono") : _("Stereo"); + } + else { + snprintf (tmp, sizeof (tmp), "%dch Multichannel", c->fmt.channels); + meta = tmp; + } } } else if (*fmt == 'V') { -- cgit v1.2.3