summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-26 16:57:38 +0100
committerwm4 <wm4@nowhere>2014-03-30 17:54:18 +0200
commite565217f22bf947552b866ff8b9a033d4fa2d65a (patch)
treefae88a74f9090f604d07422774311b8fdc3d11fe
parent144c67efaf1d2fd397b3d0b1a799a8aa2f87c7f9 (diff)
downloadmpv-e565217f22bf947552b866ff8b9a033d4fa2d65a.tar.bz2
mpv-e565217f22bf947552b866ff8b9a033d4fa2d65a.tar.xz
stream_cdda: print cd text header only if there are any cd text fields
-rw-r--r--stream/stream_cdda.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 3d13dd0f59..bc9576cd62 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -129,8 +129,8 @@ static bool print_cdtext(stream_t *s, int track)
#else
cdtext_t *text = cdio_get_cdtext(p->cd->p_cdio);
#endif
+ int header = 0;
if (text) {
- MP_INFO(s, "CD-Text (%s):\n", track ? "track" : "CD");
for (int i = 0; i < sizeof(cdtext_name) / sizeof(cdtext_name[0]); i++) {
const char *name = cdtext_name[i];
#ifdef OLD_API
@@ -138,8 +138,12 @@ static bool print_cdtext(stream_t *s, int track)
#else
const char *value = cdtext_get_const(text, i, track);
#endif
- if (name && value)
+ if (name && value) {
+ if (!header)
+ MP_INFO(s, "CD-Text (%s):\n", track ? "track" : "CD");
+ header = 1;
MP_INFO(s, " %s: '%s'\n", name, value);
+ }
}
return true;
}