summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2010-07-19 14:58:01 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2010-07-19 14:58:01 +0100
commit9a1825f0c38bab7e3831da512db11e96ff2214d2 (patch)
tree1b508c776d2a7fa92b9ad1236ad65dbd230de757 /src
parent99fac65726da3158cfcbe2323fc15bca28d304df (diff)
parentf5c747a4d6c1d01a5c15c5b5837a19ca0b4c8f1c (diff)
downloadxine-lib-9a1825f0c38bab7e3831da512db11e96ff2214d2.tar.gz
xine-lib-9a1825f0c38bab7e3831da512db11e96ff2214d2.tar.bz2
Merge from 1.1.
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_pulse_out.c53
-rw-r--r--src/demuxers/demux_ac3.c2
-rw-r--r--src/demuxers/demux_mod.c22
-rw-r--r--src/xine-engine/configfile.c7
4 files changed, 76 insertions, 8 deletions
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index c3dcac932..78ff82028 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -78,6 +78,8 @@ typedef struct pulse_driver_s {
uint32_t bits_per_sample;
uint32_t bytes_per_frame;
+ int volume_bool;
+
} pulse_driver_t;
@@ -410,6 +412,55 @@ static int ao_pulse_open(ao_driver_t *this_gen,
pa_threaded_mainloop_unlock(this->mainloop);
+ /* Now we must handle a problem: at init time, xine might have tried to set the default volume value
+ * This won't work with pulseaudio, because, at that time, pulseaudio doesn't have a stream.
+ * As a workaround, we re-do the volume thingie here */
+
+ config_values_t *cfg;
+ cfg = this->xine->config;
+
+ cfg_entry_t *entry;
+
+ if (this->volume_bool) {
+ this->volume_bool = 0;
+
+ if (this->num_channels)
+ pa_cvolume_reset(&this->cvolume, this->num_channels);
+
+ entry = cfg->lookup_entry (cfg, "audio.volume.remember_volume");
+
+ if (entry && entry->num_value) {
+ entry = cfg->lookup_entry (cfg, "audio.volume.mixer_volume");
+ if (entry) {
+ this->ao_driver.set_property(&this->ao_driver, AO_PROP_MIXER_VOL, entry->num_value);
+
+ /* Notify frontend about the volume change */
+ xine_event_t event;
+ xine_audio_level_data_t data;
+ xine_stream_t *stream;
+ xine_list_iterator_t ite;
+
+ data.right = data.left = entry->num_value;
+ data.mute = 0;
+
+ event.type = XINE_EVENT_AUDIO_LEVEL;
+ event.data = &data;
+ event.data_length = sizeof(data);
+
+ pthread_mutex_lock(&this->xine->streams_lock);
+ for(ite = xine_list_front(this->xine->streams); ite; ite =
+ xine_list_next(this->xine->streams, ite)) {
+ stream = xine_list_get_value(this->xine->streams, ite);
+ event.stream = stream;
+ xine_event_send(stream, &event);
+ }
+ pthread_mutex_unlock(&this->xine->streams_lock);
+
+ }
+ }
+
+ }
+
return this->sample_rate;
fail:
@@ -830,6 +881,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
return NULL;
}
+ this->volume_bool = 1;
+
return &this->ao_driver;
}
diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c
index 105603293..d42396f90 100644
--- a/src/demuxers/demux_ac3.c
+++ b/src/demuxers/demux_ac3.c
@@ -453,7 +453,7 @@ void *demux_ac3_init_plugin (xine_t *xine, void *data) {
this->demux_class.open_plugin = open_plugin;
this->demux_class.description = N_("Raw AC3 demux plugin");
this->demux_class.identifier = "AC3";
- this->demux_class.mimetypes = NULL;
+ this->demux_class.mimetypes = "audio/ac3: ac3: Dolby Digital audio;";
this->demux_class.extensions = "ac3";
this->demux_class.dispose = default_demux_class_dispose;
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index 7e717fc61..4de5ca7d8 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -121,6 +121,14 @@ static int probe_mod_file(demux_mod_t *this) {
return 1;
}
+ /* ScreamTracker 2 */
+ if (!memcmp (header.buffer + 20, "!Scream!", 7))
+ return 1;
+
+ /* ScreamTracker 3 */
+ if (_X_ABE_32(header.values + 0x2C / sizeof (uint32_t)) == FOURCC_32('S', 'C', 'R', 'M'))
+ return 1;
+
return 0;
}
@@ -155,13 +163,6 @@ static int open_mod_file(demux_mod_t *this) {
return 0;
}
- this->mpfile = ModPlug_Load(this->buffer, this->filesize);
- if (this->mpfile==NULL) {
- xine_log(this->stream->xine, XINE_LOG_PLUGIN, "modplug - load error\n");
- free(this->buffer);
- return 0;
- }
-
/* Set up modplug engine */
ModPlug_GetSettings(&this->settings);
this->settings.mResamplingMode = MODPLUG_RESAMPLE_FIR; /* RESAMP */
@@ -170,6 +171,13 @@ static int open_mod_file(demux_mod_t *this) {
this->settings.mFrequency = MOD_SAMPLERATE;
ModPlug_SetSettings(&this->settings);
+ this->mpfile = ModPlug_Load(this->buffer, this->filesize);
+ if (this->mpfile==NULL) {
+ xine_log(this->stream->xine, XINE_LOG_PLUGIN, "modplug - load error\n");
+ free(this->buffer);
+ return 0;
+ }
+
this->title = strdup(ModPlug_GetName(this->mpfile));
this->artist = strdup("");
this->copyright = strdup("");
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index e014f4132..e5c42f6ea 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -1001,7 +1002,13 @@ void xine_config_load (xine_t *xine, const char *filename) {
}
fclose (f_config);
+ xine_log(xine, XINE_LOG_MSG,
+ _("Loaded configuration from file '%s'\n"), filename);
+
}
+ else if (errno != ENOENT)
+ xine_log(xine, XINE_LOG_MSG,
+ _("Failed to load configuration from file '%s': %s\n"), filename, strerror (errno));
}
void xine_config_save (xine_t *xine, const char *filename) {