summaryrefslogtreecommitdiffstats
path: root/src/VLCInput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VLCInput.cpp')
-rw-r--r--src/VLCInput.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp
index 687e144..82d1d14 100644
--- a/src/VLCInput.cpp
+++ b/src/VLCInput.cpp
@@ -216,6 +216,12 @@ ssize_t VLCInput::m_read(uint8_t* buf, size_t length)
err = -1;
break;
}
+
+ char* nowplaying_sz = libvlc_media_get_meta(media, libvlc_meta_NowPlaying);
+ if (nowplaying_sz) {
+ m_nowplaying = nowplaying_sz;
+ free(nowplaying_sz);
+ }
}
return err;
}
@@ -230,5 +236,12 @@ ssize_t VLCInput::read(uint8_t* buf, size_t length)
return read;
}
+void VLCInput::write_icy_text(const std::string& filename) const
+{
+ FILE* fd = fopen(filename.c_str(), "wb");
+ fprintf(fd, "%s", m_nowplaying.c_str());
+ fclose(fd);
+}
+
#endif // HAVE_VLC