From 13174d8b23eeed7c70fa794e86b5d01042d097f0 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Wed, 26 Aug 2009 15:30:00 +0000 Subject: Garbled sound with multichannel audio (using sndio) At the moment playing multichannel audio via the sndio backend results in garbled sound. This disables the multichannel audio support until I have more time to look into a better and more appropriate fix. --- src/audio_out/audio_sndio_out.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/audio_out/audio_sndio_out.c b/src/audio_out/audio_sndio_out.c index 7c3040e6e..1d789b5e8 100644 --- a/src/audio_out/audio_sndio_out.c +++ b/src/audio_out/audio_sndio_out.c @@ -105,6 +105,7 @@ static int ao_sndio_open(ao_driver_t *this_gen, case AO_CAP_MODE_STEREO: par.pchan = 2; break; +#if 0 case AO_CAP_MODE_4CHANNEL: par.pchan = 4; break; @@ -113,6 +114,7 @@ static int ao_sndio_open(ao_driver_t *this_gen, case AO_CAP_MODE_5_1CHANNEL: par.pchan = 6; break; +#endif default: xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_sndio_out: ao_sndio_open does not support the requested mode: 0x%X\n", @@ -333,8 +335,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da * Set capabilities */ this->capabilities = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | +#if 0 AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL | AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL | +#endif AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL | AO_CAP_8BITS | AO_CAP_16BITS; -- cgit v1.2.3 From 21f1b993013b54f3909d2fa497fd6a9a9e147190 Mon Sep 17 00:00:00 2001 From: Nicos Gollan Date: Mon, 28 Sep 2009 21:07:26 +0100 Subject: RTSP debug build fix --- src/input/librtsp/rtsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index de4440b1c..8d0d45ec5 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -255,7 +255,7 @@ static int rtsp_get_answers(rtsp_t *s) { } } else { - lprintf("setting session id to: %s\n", buf); + lprintf("setting session id to: %s\n", tmp); s->session=strdup(tmp); } -- cgit v1.2.3 From 62a2bebae1e21a1c40e81d396d046af2db79eddb Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Mon, 28 Sep 2009 22:29:16 +0100 Subject: Incorrect int-to-float conversion in the JACK output plugin Using bitmeter, I found that xine's jack output suffers from the problem mentioned at the bottom of bitmeter's home page. "Although JACK itself works entirely with IEEE floating point values the conversion to and from analog audio uses integers, as do popular audio storage technologies like DAT and Red Book CDs. For correct operation JACK software which uses such integers should use the same conversion ratios as JACK itself. e.g. 16-bit samples should be divided by exactly 32768. A common mistake is to choose the value 32767 instead. You can't hear this, or see it with ordinary meters, but the bitmeter shows a clear signature for audio processed in this way. The 8th bit of the mantissa (counting the rightmost as the 0th) is orange, indicating that an unusually high percentage of samples have this bit set." (from http://users.ecs.soton.ac.uk/njl98r/code/audio/bitmeter/ via Google cache) --- src/audio_out/audio_jack_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c index 10c58c774..cd7da67cd 100644 --- a/src/audio_out/audio_jack_out.c +++ b/src/audio_out/audio_jack_out.c @@ -163,7 +163,7 @@ static int write_buffer_16 (jack_driver_t *this, unsigned char *data, int len) for (i = 0; i < samples; i++) { /* Read in 16bits, write out floats */ p_write = (float *) (&(this->buffer[write_pos])); - *p_write = ((float) (p_read[i])) / 32767.0f; + *p_write = ((float) (p_read[i])) / 32768.0f; write_pos = (write_pos + sizeof (float)) % BUFFSIZE; } this->write_pos = write_pos; -- cgit v1.2.3 From ae9b5a75d9560ec5ce88f93e89efccdf64594100 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 10 Oct 2009 12:12:07 +0100 Subject: MOD reported zero-length workaround (avoids divide-by-0). --- src/demuxers/demux_mod.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c index 34b8ebabe..de3e29ca8 100644 --- a/src/demuxers/demux_mod.c +++ b/src/demuxers/demux_mod.c @@ -178,6 +178,8 @@ static int open_mod_file(demux_mod_t *this) { this->copyright = strdup(""); this->mod_length = ModPlug_GetLength(this->mpfile); + if (this->mod_length < 1) + this->mod_length = 1; /* avoids -ve & div-by-0 */ return 1; } -- cgit v1.2.3 From b32aaa6a9fd2e871f12d902dd656d15e15dc78b1 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 10 Oct 2009 12:12:08 +0100 Subject: Fix parsing of ID3 tag content lengths. --- src/demuxers/id3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index 39055a852..070ca2650 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -259,7 +259,7 @@ static int id3v22_parse_frame_header(input_plugin_t *input, if (len == ID3V22_FRAME_HEADER_SIZE) { frame_header->id = (buf[0] << 16) + (buf[1] << 8) + buf[2]; - frame_header->size = _X_BE_24_synchsafe(&buf[3]); + frame_header->size = _X_BE_24(&buf[3]); lprintf("frame: %c%c%c: size: %zu\n", buf[0], buf[1], buf[2], frame_header->size); @@ -434,7 +434,7 @@ static int id3v23_parse_frame_ext_header(input_plugin_t *input, if (input->read (input, buf, 4) == 4) { - frame_ext_header->size = _X_BE_32_synchsafe(&buf[0]); + frame_ext_header->size = _X_BE_32(&buf[0]); if (frame_ext_header->size == 6) { if (input->read (input, buf + 4, 6) == 6) { @@ -631,7 +631,7 @@ static int id3v24_parse_frame_header(input_plugin_t *input, len = input->read (input, buf, ID3V24_FRAME_HEADER_SIZE); if (len == ID3V24_FRAME_HEADER_SIZE) { frame_header->id = _X_BE_32(buf); - frame_header->size = _X_BE_32_synchsafe(&buf[4]); + frame_header->size = _X_BE_32(&buf[4]); frame_header->flags = _X_BE_16(&buf[8]); lprintf("frame: %c%c%c%c, size: %zu, flags: %X\n", buf[0], buf[1], buf[2], buf[3], @@ -649,7 +649,7 @@ static int id3v24_parse_ext_header(input_plugin_t *input, if (input->read (input, buf, 4) == 4) { - frame_ext_header->size = _X_BE_32_synchsafe(&buf[0]); + frame_ext_header->size = _X_BE_32(&buf[0]); if (input->read (input, buf, 2) == 2) { uint8_t flags_size = buf[0]; -- cgit v1.2.3 From 44f38f11dc2420b0a93193a45b1f9c7575d055b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Laitl?= Date: Sat, 10 Oct 2009 12:12:08 +0100 Subject: Don't use deprecated JACK API xine-lib jack audio output plugin still uses deprecated jack_client_new() function. This function has been superseded by jack_client_open(). New API has an advantage that jackd is allowed to alter name of the client in case of ambiguity. --- src/audio_out/audio_jack_out.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c index cd7da67cd..6394fd3e3 100644 --- a/src/audio_out/audio_jack_out.c +++ b/src/audio_out/audio_jack_out.c @@ -308,19 +308,11 @@ static int jack_open_device (ao_driver_t *this_gen, char *jack_device, num_channels); goto err_out; } - /* Try to create a client called "xine" */ - if ((client = jack_client_new ("xine")) == 0) { - /* If that doesn't work it could be because running two copies of xine - try using a unique name */ - char client_name[20]; - sprintf (client_name, "xine (%d)", (int) getpid ()); - - if ((client = jack_client_new (client_name)) == 0) { - xprintf (this->xine, XINE_VERBOSITY_LOG, - "\njack_open_device: Error: Failed to connect to JACK server\n"); - xprintf (this->xine, XINE_VERBOSITY_LOG, - "jack_open_device: (did you start 'jackd' server?)\n"); - goto err_out; - } + /* Try to create a client called "xine[-NN]" */ + if ((client = jack_client_open ("xine", JackNullOption, NULL)) == 0) { + xprintf (this->xine, XINE_VERBOSITY_LOG, + "\njack_open_device: Error: Failed to connect to JACK server\n"); + goto err_out; } /* Save the new client */ @@ -718,19 +710,11 @@ static ao_driver_t *open_jack_plugin (audio_driver_class_t *class_gen, #define A52_PASSTHRU 12 int speakers; - /* Try to create a client called "xine" */ - if ((client = jack_client_new ("xine")) == 0) { - /* If that doesn't work it could be because running two copies of xine - try using a unique name */ - char name[20]; - sprintf (name, "xine (%d)", (int) getpid ()); - - if ((client = jack_client_new (name)) == 0) { - xprintf (class->xine, XINE_VERBOSITY_LOG, - "\nopen_jack_plugin: Error: Failed to connect to JACK server\n"); - xprintf (class->xine, XINE_VERBOSITY_LOG, - "open_jack_plugin: (did you start 'jackd' server?)\n"); - return 0; - } + /* Try to create a client called "xine[-NN]" */ + if ((client = jack_client_open ("xine", JackNullOption, NULL)) == 0) { + xprintf (class->xine, XINE_VERBOSITY_LOG, + "\nopen_jack_plugin: Error: Failed to connect to JACK server\n"); + return 0; } this = calloc(1, sizeof (jack_driver_t)); -- cgit v1.2.3