# HG changeset patch # User Matti Hamalainen # Date 1190170118 -10800 # Node ID 29d0e4435e0ecac6ad4a6b3b696760d3a93fc0d9 # Parent b3decbd3051b63d4547cd2781e2e844889e1b12e# Parent 35f8a5fbd1b6121fa9d939a3ebb48f45bd57fef3 Automated merge with ssh://hg.atheme.org//hg/audacious-plugins diff -r b3decbd3051b -r 29d0e4435e0e src/console/Audacious_Driver.cxx --- a/src/console/Audacious_Driver.cxx Wed Sep 19 05:16:22 2007 +0300 +++ b/src/console/Audacious_Driver.cxx Wed Sep 19 05:48:38 2007 +0300 @@ -110,7 +110,7 @@ *args = '\0'; // TODO: use func with better error reporting, and perhaps don't // truncate path if there is no number after ? - track = atoi( args + 1 ); + track = atoi( args + 1 ) - 1; track_specified = true; } @@ -217,7 +217,9 @@ if ( info.track_count > 1 ) { tuple_associate_int(ti, FIELD_TRACK_NUMBER, NULL, track + 1); - tuple_associate_int(ti, -1, "subsong", track); + tuple_associate_int(ti, -1, "subsong", track + 1); + tuple_associate_int(ti, FIELD_SUBSONG_ID, NULL, track + 1); + tuple_associate_int(ti, FIELD_SUBSONG_NUM, NULL, info.track_count); } tuple_associate_string(ti, FIELD_COPYRIGHT, NULL, info.copyright); tuple_associate_string(ti, -1, "console", info.system); @@ -444,6 +446,8 @@ File_Handler fh( path, fd, TRUE ); if ( fh.type ) { + result = 1; + /* if ( fh.track_specified || fh.type->track_count == 1 ) { // don't even need to read file if track is specified or @@ -470,6 +474,7 @@ result = -1; } } + */ } else if (fh.track_specified) { @@ -479,6 +484,16 @@ return result; } +static Tuple *probe_for_tuple(gchar *filename, VFSFile *fd) +{ + if (!is_our_file_from_vfs(filename, fd)) + return NULL; + + vfs_rewind(fd); + + return get_song_tuple(filename); +} + // Setup static void console_init(void) @@ -538,7 +553,9 @@ NULL, NULL, is_our_file_from_vfs, - (gchar **)gme_fmts + (gchar **)gme_fmts, + NULL, + probe_for_tuple }; InputPlugin *console_iplist[] = { &console_ip, NULL }; diff -r b3decbd3051b -r 29d0e4435e0e src/neon/neon.c --- a/src/neon/neon.c Wed Sep 19 05:16:22 2007 +0300 +++ b/src/neon/neon.c Wed Sep 19 05:48:38 2007 +0300 @@ -160,13 +160,15 @@ * ----- */ +#define TAGSIZE 4096 + static void parse_icy(struct icy_metadata* m, gchar* metadata, int len) { gchar* p; gchar* tstart; gchar* tend; - gchar name[4096]; - gchar value[4096]; + gchar name[TAGSIZE]; + gchar value[TAGSIZE]; int state; int pos; @@ -190,7 +192,7 @@ * End of tag name. */ *p = '\0'; - strcpy(name, tstart); + g_strlcpy(name, tstart, TAGSIZE); _DEBUG("Found tag name: %s", name); state = 2; } else { @@ -219,7 +221,7 @@ * End of value */ *p = '\0'; - strcpy(value, tstart); + g_strlcpy(value, tstart, TAGSIZE); _DEBUG("Found tag value: %s", value); add_icy(m, name, value); state = 4;