aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-19 22:52:03 +0000
committerGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-19 22:52:03 +0000
commit00857cf5ce3895b714dcf4cdb728a91dceb420ff (patch)
tree50e6200afa48b18af3644d2929b0662687af75e5 /libmpdemux
parent3d37f2a4f312d58bda7df07f1a477f3a1e5ad774 (diff)
Disassemble comments and pass it to the demux_info interface
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16538 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_ogg.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 71653f83d5..893decaf57 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -439,18 +439,28 @@ static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vor
{
char *hdr, *val;
char **cmt = vc->user_comments;
- int index;
+ int index, i;
ogg_demuxer_t *ogg_d = (ogg_demuxer_t *)d->priv;
+ struct table {
+ char *ogg;
+ char *mp;
+ } table[] = {
+ { "ENCODED_USING", "Software" },
+ { "ENCODER_URL", "Encoder URL" },
+ { "TITLE", "Name" },
+ { "ARTIST", "Artist" },
+ { "COMMENT", "Comments" },
+ { "DATE", "Creation Date" },
+ { "GENRE", "Genre" },
+ { "ALBUM", "Album" },
+ { "TRACKNUMBER", "Track" },
+ { NULL, NULL },
+ };
while(*cmt)
{
hdr = NULL;
- if (!strncasecmp(*cmt, "ENCODED_USING=", 14))
- {
- hdr = "Software";
- val = *cmt + 14;
- }
- else if (!strncasecmp(*cmt, "LANGUAGE=", 9))
+ if (!strncasecmp(*cmt, "LANGUAGE=", 9))
{
val = *cmt + 9;
if (identify)
@@ -479,18 +489,19 @@ static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vor
else
hdr = "Language";
}
- else if (!strncasecmp(*cmt, "ENCODER_URL=", 12))
- {
- hdr = "Encoder URL";
- val = *cmt + 12;
- }
- else if (!strncasecmp(*cmt, "TITLE=", 6))
- {
- hdr = "Name";
- val = *cmt + 6;
+ else {
+ for (i = 0; table[i].ogg; i++)
+ {
+ if (!strncasecmp(*cmt, table[i].ogg, strlen(table[i].ogg)))
+ {
+ hdr = table[i].mp;
+ val = *cmt + strlen(table[i].ogg) + 1;
+ }
+ }
}
+ demux_info_add(d, hdr, val);
if (hdr)
- mp_msg(MSGT_DEMUX, MSGL_V, " %s: %s\n", hdr, val);
+ mp_dbg(MSGT_DEMUX, MSGL_DBG2, " %s: %s\n", hdr, val);
cmt++;
}
}