summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-09 21:48:44 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-09 21:48:44 +0100
commitfeb75686e0dfe37fa1357b108152dad9da901304 (patch)
tree769c4236fbe50b0ac7f9d9bf6873338623ac1413 /playlist.c
parent01812fd806c3f3a5f727071a4a37946276ca5990 (diff)
fixed %Z title formatting crash
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c14
1 files changed, 8 insertions, 6 deletions
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') {