summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 14:51:59 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 14:51:59 +0100
commit9fabfc06b3dade2f8012d5605ff244bf46391d2c (patch)
treedf67b06039e37ae4490db89f7779bed4b12e045b /src
parentac4a311c81c5d01cfbc332d248907bb833ecfed3 (diff)
parent44f38f11dc2420b0a93193a45b1f9c7575d055b2 (diff)
downloadxine-lib-9fabfc06b3dade2f8012d5605ff244bf46391d2c.tar.gz
xine-lib-9fabfc06b3dade2f8012d5605ff244bf46391d2c.tar.bz2
Merge from 1.1.
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_jack_out.c38
-rw-r--r--src/audio_out/audio_sndio_out.c4
-rw-r--r--src/demuxers/demux_mod.c2
-rw-r--r--src/demuxers/id3.c8
-rw-r--r--src/input/librtsp/rtsp.c2
5 files changed, 22 insertions, 32 deletions
diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c
index c73cf4b5c..f65fbd9b0 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;
@@ -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));
diff --git a/src/audio_out/audio_sndio_out.c b/src/audio_out/audio_sndio_out.c
index 7ee371b5d..48e77c3b4 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;
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index cd55f6781..64d5b3856 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -175,6 +175,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;
}
diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c
index 6ca05aa86..7cc7255e0 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);
@@ -426,7 +426,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) {
@@ -615,7 +615,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],
@@ -633,7 +633,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];
diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c
index e8f816bb2..710ab8711 100644
--- a/src/input/librtsp/rtsp.c
+++ b/src/input/librtsp/rtsp.c
@@ -252,7 +252,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);
}