diff options
author | waker <wakeroid@gmail.com> | 2012-11-09 21:48:44 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-11-09 21:48:44 +0100 |
commit | feb75686e0dfe37fa1357b108152dad9da901304 (patch) | |
tree | 769c4236fbe50b0ac7f9d9bf6873338623ac1413 | |
parent | 01812fd806c3f3a5f727071a4a37946276ca5990 (diff) |
fixed %Z title formatting crash
-rw-r--r-- | playlist.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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') { |