summaryrefslogtreecommitdiffstats
path: root/src/VLCInput.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-12 08:46:12 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-12 08:46:12 +0200
commit5637664fcbe18b05a773d6db621a94de76e07817 (patch)
tree6d1891004e9d7977d02891fa22de642aac640b17 /src/VLCInput.cpp
parent28f95670d7f1497dc58f8820ab09475e4917d4ba (diff)
downloadfdk-aac-5637664fcbe18b05a773d6db621a94de76e07817.tar.gz
fdk-aac-5637664fcbe18b05a773d6db621a94de76e07817.tar.bz2
fdk-aac-5637664fcbe18b05a773d6db621a94de76e07817.zip
VLC can write ICY Text into a file for mot-encoder
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