comparison src/madplug/plugin.c @ 2988:059285b5de7c

Make the MP3 validation checks less restrictive with shoutcast streams.
author William Pitcock <nenolod@atheme.org>
date Fri, 05 Dec 2008 07:11:37 -0600
parents 6ace9600e4b5
children fc666525b410
comparison
equal deleted inserted replaced
2987:58c63fbbd3ce 2988:059285b5de7c
275 ((guint32) hbuf[1] << 16) | 275 ((guint32) hbuf[1] << 16) |
276 ((guint32) hbuf[2] << 8) | 276 ((guint32) hbuf[2] << 8) |
277 ((guint32) hbuf[3]); 277 ((guint32) hbuf[3]);
278 } 278 }
279 279
280 #undef MADPROBE_DEBUG 280 //#undef MADPROBE_DEBUG
281 //#define MADPROBE_DEBUG 281 #define MADPROBE_DEBUG
282 282
283 #ifdef MADPROBE_DEBUG 283 #ifdef MADPROBE_DEBUG
284 static gchar *mp3_ver_table[4] = { "2.5", "INVALID", "2", "1" }; 284 static gchar *mp3_ver_table[4] = { "2.5", "INVALID", "2", "1" };
285 #define LULZ(...) do { fprintf(stderr, "madprobe: "); fprintf(stderr, __VA_ARGS__); } while (0) 285 #define LULZ(...) do { fprintf(stderr, "madprobe: "); fprintf(stderr, __VA_ARGS__); } while (0)
286 #define LOL(...) do { fprintf(stderr, __VA_ARGS__); } while (0) 286 #define LOL(...) do { fprintf(stderr, __VA_ARGS__); } while (0)
399 frame.layer != prev.layer || 399 frame.layer != prev.layer ||
400 frame.version != prev.version) { 400 frame.version != prev.version) {
401 /* Not similar frame... */ 401 /* Not similar frame... */
402 LOL(" .. but does not match (%d)!\n", chkcount); 402 LOL(" .. but does not match (%d)!\n", chkcount);
403 state = STATE_RESYNC; 403 state = STATE_RESYNC;
404 } else if (chkcount >= 3) { 404 } else if (chkcount >= info.remote ? 2 : 3) {
405 /* Okay, accept this stream */ 405 /* Okay, accept this stream */
406 LOL(" .. accepted as mp3!!!\n"); 406 LOL(" .. accepted as mp3!!!\n");
407 return 1; 407 return 1;
408 } else { 408 } else {
409 LOL(" .. match %d\n", chkcount); 409 LOL(" .. match %d\n", chkcount);