diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-30 18:29:22 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-30 18:29:22 +0100 |
commit | 3a68e7c2ca41e9c13e4930ce644418ab75681765 (patch) | |
tree | 9b22cbcacead5277a2a8c5d11621d3e5944831c5 /plugins | |
parent | a4f7dc1214eefa15a4a9bb2f166ea7b09b4985b2 (diff) |
icy-metadata support for mp3 streams
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mpgmad/mpgmad.c | 16 | ||||
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c index f02c9506..ea09cc8e 100644 --- a/plugins/mpgmad/mpgmad.c +++ b/plugins/mpgmad/mpgmad.c @@ -87,6 +87,7 @@ typedef struct { int avg_samplerate; int avg_samples_per_frame; int nframes; + int last_comment_update; } buffer_t; static buffer_t buffer; @@ -830,6 +831,21 @@ cmp3_stream_frame (void) { deadbeef->streamer_set_bitrate (frame.header.bitrate/1000); break; } + + if (!eof) { + if (buffer.file->vfs->streaming && buffer.currentsample - buffer.last_comment_update > 5 * plugin.info.samplerate) { + int idx = deadbeef->pl_get_idx_of (buffer.it); + if (idx >= 0) { + buffer.last_comment_update = buffer.currentsample; + const char *vfs_tit = deadbeef->fget_content_name (buffer.file); + if (vfs_tit) { + deadbeef->pl_replace_meta (buffer.it, "title", vfs_tit); + deadbeef->sendmessage (M_TRACKCHANGED, 0, idx, 0); + } + } + } + } + return eof; } diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index 181e052b..ca30024b 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -24,8 +24,8 @@ #include <curl/curlver.h> #include "../../deadbeef.h" -#define trace(...) { fprintf(stderr, __VA_ARGS__); } -//#define trace(fmt,...) +//#define trace(...) { fprintf(stderr, __VA_ARGS__); } +#define trace(fmt,...) #define min(x,y) ((x)<(y)?(x):(y)) #define max(x,y) ((x)>(y)?(x):(y)) |