# HG changeset patch # User yaz # Date 1170824475 28800 # Node ID 951b24719ce95dd2e134a61232ece556b00c9de8 # Parent 3f7a52adfe0e0b500b3b4c98c65153b8228a9a5b [svn] - fix for audmad_is_our_fd() - added my TODO list ;p diff -r 3f7a52adfe0e -r 951b24719ce9 ChangeLog --- a/ChangeLog Tue Feb 06 12:11:42 2007 -0800 +++ b/ChangeLog Tue Feb 06 21:01:15 2007 -0800 @@ -1,3 +1,22 @@ +2007-02-06 20:11:42 +0000 Yoshiki Yazawa + revision [1308] + merge recent changes from yaz's branch. + - stable shoutcast playback. + - tag handling improvement. + - view track detail on streaming won't crash. (disabled.) + - filepopup for streaming is partially supported. filepopup displays track name and stream name, but not updated automatically. + + trunk/src/madplug/configure.c | 119 +++++++++++++ + trunk/src/madplug/decoder.c | 113 ++++++++---- + trunk/src/madplug/fileinfo.c | 369 +++++++++++++++++++++++++++++++++++++---- + trunk/src/madplug/input.c | 100 +++++++---- + trunk/src/madplug/input.h | 2 + trunk/src/madplug/plugin.c | 168 +++++++++++++++--- + trunk/src/madplug/plugin.h | 25 ++ + trunk/src/madplug/replaygain.c | 55 +++--- + 8 files changed, 779 insertions(+), 172 deletions(-) + + 2007-02-05 20:28:01 +0000 William Pitcock revision [1306] - add madplug. It is not yet hooked up, I'll do that later. diff -r 3f7a52adfe0e -r 951b24719ce9 src/madplug/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/madplug/TODO Tue Feb 06 21:01:15 2007 -0800 @@ -0,0 +1,15 @@ +-: to do, X: done, x: test needed, ?: questionableness + +X remove info->stop +X frame_name == ID3_FRAME_COMMENT code highly depends on address of strings. strcmp() is safer way. +X replace copy right notices +X import title override feature +x import neno's configure dialog +- bug fix: press F5 on not yet played stream hangs. +- tidy up mad_info_t +- remove pb_mutex ? +x replace tag editor with neno's +X rename files for convenience of taking diff +- utf8 id3v1 writing ?? (it requires modification to libid3tag.) +- complete tag deletion code +- stream recording feature ?? diff -r 3f7a52adfe0e -r 951b24719ce9 src/madplug/input.c --- a/src/madplug/input.c Tue Feb 06 12:11:42 2007 -0800 +++ b/src/madplug/input.c Tue Feb 06 21:01:15 2007 -0800 @@ -397,7 +397,7 @@ gboolean input_get_info(struct mad_info_t *info, gboolean fast_scan) { #ifdef DEBUG - g_message("f: input_get_info: %s", info->title); + g_message("f: input_get_info: %s, fast_scan = %s", info->title, fast_scan ? "TRUE" : "FALSE"); #endif /* DEBUG */ input_read_tag(info); input_read_replaygain(info); diff -r 3f7a52adfe0e -r 951b24719ce9 src/madplug/plugin.c --- a/src/madplug/plugin.c Tue Feb 06 12:11:42 2007 -0800 +++ b/src/madplug/plugin.c Tue Feb 06 21:01:15 2007 -0800 @@ -186,8 +186,7 @@ ((unsigned long) hbuf[2] << 8) | (unsigned long) hbuf[3]; } -#if 0 -// XXX: can't add remote stream from add URL dialog. temporally disabled. + // audacious vfs fast version static int audmad_is_our_fd(char *filename, VFSFile *fin) { @@ -198,6 +197,14 @@ guchar tmp[4096]; gint ret, i; +#if 1 + // XXX: temporary fix + if (!strncasecmp("http://", filename, 7) || !strncasecmp("https://", filename, 8)) { + g_message("audmad_is_our_fe: remote"); + info.remote = TRUE; + } +#endif + /* I've seen some flac files beginning with id3 frames.. so let's exclude known non-mp3 filename extensions */ if (!strcasecmp(".flac", ext) || !strcasecmp(".mpc", ext) || @@ -225,7 +232,7 @@ while (!mp3_head_check(check)) { ret = vfs_fread(tmp, 1, 4096, fin); - if (ret == 0) + if (ret == 0) return 0; for (i = 0; i < ret; i++) @@ -243,64 +250,6 @@ return 1; } -#endif - -// this function will be replaced soon. -static int audmad_is_our_fd(char *filename, VFSFile *fin) -{ - int rtn = 0; - guchar check[4]; - - info.remote = FALSE; //awkward... - -#ifdef DEBUG - g_message("audmad: filename = %s\n", filename); -#endif - - // 0. if url is beginning with http://, take it blindly. - if (!strncasecmp("http://", filename, strlen("http://")) || - !strncasecmp("https://", filename, strlen("https://"))) { - g_message("audmad: remote\n"); - info.remote = TRUE; - return 1; //ours - } - - // 1. check embeded signature - if (fin && vfs_fread(check, 1, 4, fin) == 4) { - /* - * or three bytes are "ID3" - */ - if (mp3_head_check(check)) { - rtn = 1; - } - else if (memcmp(check, "ID3", 3) == 0) { - rtn = 1; - } - else if (memcmp(check, "RIFF", 4) == 0) { - vfs_fseek(fin, 4, SEEK_CUR); - vfs_fread(check, 1, 4, fin); - - if (memcmp(check, "RMP3", 4) == 0) { - rtn = 1; - } - } - } - // 2. exclude files with folloing extensions - if (strcasecmp("flac", filename + strlen(filename) - 4) == 0 || - strcasecmp("mpc", filename + strlen(filename) - 3) == 0 || - strcasecmp("tta", filename + strlen(filename) - 3) == 0) { - rtn = 0; - goto tail; - } - - // 3. if we haven't found any signature, take the files with .mp3 extension. - if (rtn == 0 && strcasecmp("mp3", filename + strlen(filename) - 3) == 0) { - rtn = 1; - } - - tail: - return rtn; -} // audacious vfs version static int audmad_is_our_file(char *filename) @@ -323,7 +272,7 @@ { #ifdef DEBUG g_message("f: audmad_stop"); -#endif /* DEBUG */ +#endif g_mutex_lock(mad_mutex); info.playback = playback; g_mutex_unlock(mad_mutex); @@ -337,18 +286,18 @@ #ifdef DEBUG g_message("waiting for thread"); -#endif /* DEBUG */ +#endif g_thread_join(decode_thread); #ifdef DEBUG g_message("thread done"); -#endif /* DEBUG */ +#endif input_term(&info); decode_thread = NULL; } #ifdef DEBUG g_message("e: audmad_stop"); -#endif /* DEBUG */ +#endif } static void audmad_play_file(InputPlayback *playback)