From cce0fd6bbc99da33f4064abeb453ade4ca11b05e Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Fri, 23 Nov 2007 18:00:34 +0100 Subject: fix read_ogg_packet to really read all of the data; don't go into DEMUX_FINISHED from send_header --- src/demuxers/demux_ogg.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/demuxers') diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index a23bfa6b6..d38b2de7a 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -236,13 +236,19 @@ static int64_t get_pts (demux_ogg_t *this, int stream_num , int64_t granulepos ) static int read_ogg_packet (demux_ogg_t *this) { char *buffer; long bytes; + long total = 0; while (ogg_sync_pageout(&this->oy,&this->og)!=1) { buffer = ogg_sync_buffer(&this->oy, CHUNKSIZE); bytes = this->input->read(this->input, buffer, CHUNKSIZE); - ogg_sync_wrote(&this->oy, bytes); - if (bytes < CHUNKSIZE/2) { - return 0; + if (bytes == 0) { + if (total == 0) { + printf("read_ogg_packet read nothing\n"); + return 0; + } + break; } + ogg_sync_wrote(&this->oy, bytes); + total += bytes; } return 1; } @@ -1349,7 +1355,6 @@ static void send_header (demux_ogg_t *this) { while (!done) { if (!read_ogg_packet(this)) { - this->status = DEMUX_FINISHED; return; } /* now we've got at least one new page */ -- cgit v1.2.3 From 58e0ac62331612c9893b7b9054ac5ecaba677700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 24 Nov 2007 20:41:43 +0100 Subject: Add option to disable Nosefart/NSF plugin building. This way you can get a safer build for binary redistribution. --- src/demuxers/Makefile.am | 6 +++++- src/demuxers/group_audio.c | 4 ++++ src/demuxers/group_audio.h | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/demuxers') diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am index 83c29f4e3..1d2e41e38 100644 --- a/src/demuxers/Makefile.am +++ b/src/demuxers/Makefile.am @@ -11,6 +11,10 @@ if BUILD_ASF asf_module = xineplug_dmx_asf.la endif +if BUILD_NOSEFART +nsf_demuxer = demux_nsf.c +endif + if HAVE_LIBMNG mng_module = xineplug_dmx_mng.la endif @@ -104,7 +108,7 @@ xineplug_dmx_games_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) xineplug_dmx_games_la_LDFLAGS = -avoid-version -module xineplug_dmx_audio_la_SOURCES = group_audio.c demux_aud.c demux_aiff.c \ - demux_cdda.c demux_mpgaudio.c demux_nsf.c \ + demux_cdda.c demux_mpgaudio.c $(nsf_demuxer) \ demux_realaudio.c demux_snd.c demux_voc.c \ demux_vox.c demux_wav.c demux_ac3.c id3.c \ demux_aac.c demux_mod.c demux_flac.c \ diff --git a/src/demuxers/group_audio.c b/src/demuxers/group_audio.c index bd3932b36..2643a8b80 100644 --- a/src/demuxers/group_audio.c +++ b/src/demuxers/group_audio.c @@ -69,9 +69,11 @@ static const demuxer_info_t demux_info_mpc = { 1 /* priority */ }; +#ifdef HAVE_NOSEFART static const demuxer_info_t demux_info_nsf = { 10 /* priority */ }; +#endif static const demuxer_info_t demux_info_realaudio = { 10 /* priority */ @@ -118,7 +120,9 @@ const plugin_info_t xine_plugin_info[] EXPORTED = { { PLUGIN_DEMUX, 26, "flac", XINE_VERSION_CODE, &demux_info_flac, demux_flac_init_plugin }, { PLUGIN_DEMUX, 26, "mp3", XINE_VERSION_CODE, &demux_info_mpgaudio, demux_mpgaudio_init_class }, { PLUGIN_DEMUX, 26, "mpc", XINE_VERSION_CODE, &demux_info_mpc, demux_mpc_init_plugin }, +#ifdef HAVE_NOSEFART { PLUGIN_DEMUX, 26, "nsf", XINE_VERSION_CODE, &demux_info_nsf, demux_nsf_init_plugin }, +#endif { PLUGIN_DEMUX, 26, "realaudio", XINE_VERSION_CODE, &demux_info_realaudio, demux_realaudio_init_plugin }, { PLUGIN_DEMUX, 26, "shn", XINE_VERSION_CODE, &demux_info_shn, demux_shn_init_plugin }, { PLUGIN_DEMUX, 26, "snd", XINE_VERSION_CODE, &demux_info_snd, demux_snd_init_plugin }, diff --git a/src/demuxers/group_audio.h b/src/demuxers/group_audio.h index 6b74d9feb..424e5c8e0 100644 --- a/src/demuxers/group_audio.h +++ b/src/demuxers/group_audio.h @@ -32,7 +32,6 @@ void *demux_dts_init_plugin (xine_t *xine, void *data); void *demux_flac_init_plugin (xine_t *xine, void *data); void *demux_mpgaudio_init_class (xine_t *xine, void *data); void *demux_mpc_init_plugin (xine_t *xine, void *data); -void *demux_nsf_init_plugin (xine_t *xine, void *data); void *demux_realaudio_init_plugin (xine_t *xine, void *data); void *demux_shn_init_plugin (xine_t *xine, void *data); void *demux_snd_init_plugin (xine_t *xine, void *data); @@ -41,6 +40,10 @@ void *demux_voc_init_plugin (xine_t *xine, void *data); void *demux_vox_init_plugin (xine_t *xine, void *data); void *demux_wav_init_plugin (xine_t *xine, void *data); +#ifdef HAVE_NOSEFART +void *demux_nsf_init_plugin (xine_t *xine, void *data); +#endif + #ifdef HAVE_MODPLUG void *demux_mod_init_plugin (xine_t *xine, void *data); #endif -- cgit v1.2.3 From e2c171334683d0888ce992d1e41c8019e7a7bbc8 Mon Sep 17 00:00:00 2001 From: Maximilian Schwerin Date: Sun, 25 Nov 2007 19:21:29 +0000 Subject: patch adding additional ID3 genres --- src/demuxers/id3.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/demuxers') diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index 1613e3a19..bcb07e7e4 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -45,7 +45,7 @@ #include "bswap.h" #include "id3.h" -#define ID3_GENRE_COUNT 126 +#define ID3_GENRE_COUNT 148 static const char* const id3_genre[] = {"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", @@ -72,7 +72,11 @@ static const char* const id3_genre[] = "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", - "Dance Hall" }; + "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", + "Indie", "BritPop", "Negerpunk", "Polsk Punk", "Beat", + "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover", + "Contemporary Christian", "Christian Rock", "Merengue", "Salsa", + "Thrash Metal", "Anime", "JPop", "Synthpop" }; #define ID3_ENCODING_COUNT 4 static const char* const id3_encoding[] = { @@ -598,7 +602,7 @@ static int id3v24_parse_genre(char* dest, char *src, int len) { int index = 0; dest[0] = '\0'; - if (sscanf(src, "%2d", &index) == 1) { + if (sscanf(src, "%d", &index) == 1) { if (index < ID3_GENRE_COUNT) { strncpy(dest, id3_genre[index], len); dest[len - 1] = '\0'; -- cgit v1.2.3 From 70b092f7f0867bea62416ec9a86fe5e967829caa Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 25 Nov 2007 19:24:27 +0000 Subject: Avoid any future need to alter ID3_GENRE_COUNT. --- src/demuxers/id3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/demuxers') diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index bcb07e7e4..0287447ce 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -45,7 +45,7 @@ #include "bswap.h" #include "id3.h" -#define ID3_GENRE_COUNT 148 +#define ID3_GENRE_COUNT (sizeof (id3_genre) / sizeof (id3_genre[0])) static const char* const id3_genre[] = {"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", -- cgit v1.2.3 From 0e2e43f9050cde0fd5c34d4848cda31bb4ef6a2e Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 25 Nov 2007 21:19:49 +0000 Subject: Fix a signedness issue in genre number validation. Negative values would be accepted, resulting in junk in XINE_META_INFO_GENRE or a segfault. --- src/demuxers/id3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/demuxers') diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index 0287447ce..6b36cc666 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -599,15 +599,15 @@ int id3v23_parse_tag(input_plugin_t *input, /* id3v2 "genre" parsing code. what a ugly format ! */ static int id3v24_parse_genre(char* dest, char *src, int len) { - int index = 0; + unsigned int index = 0; dest[0] = '\0'; - if (sscanf(src, "%d", &index) == 1) { + if (sscanf(src, "%u", &index) == 1) { if (index < ID3_GENRE_COUNT) { strncpy(dest, id3_genre[index], len); dest[len - 1] = '\0'; } else { - lprintf("invalid index: %d\n", index); + lprintf("invalid index: %u\n", index); } } return 1; -- cgit v1.2.3