summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_alsa_out.c2
-rw-r--r--src/audio_out/audio_pulse_out.c113
-rw-r--r--src/demuxers/demux_asf.c4
-rw-r--r--src/demuxers/demux_qt.c6
-rw-r--r--src/demuxers/id3.c2
-rw-r--r--src/video_out/video_out_opengl.c2
-rw-r--r--src/video_out/xxmc.h4
7 files changed, 98 insertions, 35 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 3e3564a3b..1eaa5d0d0 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -404,7 +404,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
err = snd_pcm_hw_params_set_access_mask(this->audio_fd, params, mask);
if (err < 0) {
xprintf (this->class->xine, XINE_VERBOSITY_DEBUG,
- "audio_alsa_out: mmap not availiable, falling back to compatiblity mode\n");
+ "audio_alsa_out: mmap not available, falling back to compatiblity mode\n");
this->mmap=0;
err = snd_pcm_hw_params_set_access(this->audio_fd, params,
SND_PCM_ACCESS_RW_INTERLEAVED);
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index 78ff82028..bd057501b 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -202,7 +202,8 @@ static void __xine_pa_context_success_callback(pa_context *c, int success, void
* instance.
*
* This function saves the volume field of the passed structure to the
- * @c cvolume variable of the output instance.
+ * @c cvolume variable of the output instance and send an update volume
+ * event to the frontend.
*/
static void __xine_pa_sink_info_callback(pa_context *c, const pa_sink_input_info *info,
int is_last, void *userdata) {
@@ -226,6 +227,66 @@ static void __xine_pa_sink_info_callback(pa_context *c, const pa_sink_input_info
#else
this->muted = pa_cvolume_is_muted (&this->cvolume);
#endif
+
+ /* send update volume event to frontend */
+
+ xine_event_t event;
+ xine_audio_level_data_t data;
+ xine_stream_t *stream;
+ xine_list_iterator_t ite;
+
+ data.right = data.left = (int) (pa_sw_volume_to_linear(this->swvolume)*100);
+
+ data.mute = this->muted;
+
+ 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);
+}
+
+/**
+ * @brief Callback function called when the state of the daemon changes
+ * @param c Context in which the state of the daemon changes
+ * @param t Subscription event type
+ * @param idx Index of the sink
+ * @param this_gen pulse_driver_t pointer for the PulseAudio output
+ * instance.
+ */
+static void __xine_pa_context_subscribe_callback(pa_context *c,
+ pa_subscription_event_type_t t, uint32_t idx, void *this_gen)
+{
+ pulse_driver_t * this = (pulse_driver_t*) this_gen;
+ int index;
+
+ if (this->stream == NULL)
+ return;
+
+ index = pa_stream_get_index(this->stream);
+
+ if (index != idx)
+ return;
+
+ if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) != PA_SUBSCRIPTION_EVENT_CHANGE)
+ return;
+
+ pa_operation *operation = pa_context_get_sink_input_info(
+ this->context, index, __xine_pa_sink_info_callback, this);
+
+ if (operation == NULL) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_pulse_out: failed to get sink info: %s\n", pa_strerror(pa_context_errno (this->context)));
+ return;
+ }
+
+ pa_operation_unref(operation);
}
static int connect_context(pulse_driver_t *this) {
@@ -248,6 +309,10 @@ static int connect_context(pulse_driver_t *this) {
_x_assert(this->context);
pa_context_set_state_callback(this->context, __xine_pa_context_state_callback, this);
+
+ /* set subscribe callback (for volume change information) */
+
+ pa_context_set_subscribe_callback(this->context, __xine_pa_context_subscribe_callback, this);
}
if (pa_context_get_state(this->context) == PA_CONTEXT_UNCONNECTED) {
@@ -272,6 +337,17 @@ static int connect_context(pulse_driver_t *this) {
pa_threaded_mainloop_wait(this->mainloop);
}
+ /* subscribe to sink input events (for volume change information) */
+
+ pa_operation *operation = pa_context_subscribe(this->context,
+ PA_SUBSCRIPTION_MASK_SINK_INPUT,
+ __xine_pa_context_success_callback, this);
+
+ if (operation == NULL) {
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_pulse_out: failed to enable event notification: %s\n", pa_strerror(pa_context_errno(this->context)));
+ return -1;
+ }
+
return 0;
}
@@ -433,34 +509,23 @@ static int ao_pulse_open(ao_driver_t *this_gen,
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);
-
}
}
+ }
+
+ /* get pa sink input information to trigger a update volume event in the frontend */
+
+ pa_operation *operation = pa_context_get_sink_input_info(
+ this->context, pa_stream_get_index(this->stream),
+ __xine_pa_sink_info_callback, this);
+ if (operation == NULL) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_pulse_out: failed to get sink info: %s\n", pa_strerror(pa_context_errno (this->context)));
+ goto fail;
}
+ pa_operation_unref(operation);
+
return this->sample_rate;
fail:
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index f125e9973..186caa2fe 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -1961,7 +1961,7 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
start_pos -= this->packet_size;
}
if (state != 5) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: demux_asf_seek: begining of the stream\n");
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: demux_asf_seek: beginning of the stream\n");
this->input->seek (this->input, this->first_packet_pos, SEEK_SET);
this->keyframe_found = 1;
} else {
@@ -2079,7 +2079,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
default:
xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_asf: warning, unkown method %d\n", stream->content_detection_method);
+ "demux_asf: warning, unknown method %d\n", stream->content_detection_method);
return NULL;
}
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 9ba70ebbb..c944e3c9e 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -3174,9 +3174,9 @@ static void *init_plugin (xine_t *xine, void *data) {
"video/quicktime: mov,qt: Quicktime animation;"
"video/x-quicktime: mov,qt: Quicktime animation;"
"audio/x-m4a: m4a,m4b: MPEG-4 audio;"
- "video/mp4: mp4,mpg4: MPEG-4 video;"
- "audio/mp4: mp4,mpg4: MPEG-4 audio;";
- this->demux_class.extensions = "mov qt mp4 m4a m4b";
+ "video/mp4: f4v,mp4,mpg4: MPEG-4 video;"
+ "audio/mp4: f4a,mp4,mpg4: MPEG-4 audio;";
+ this->demux_class.extensions = "mov qt mp4 m4a m4b f4a f4v";
this->demux_class.dispose = default_demux_class_dispose;
return this;
diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c
index ea28f5666..2b433f515 100644
--- a/src/demuxers/id3.c
+++ b/src/demuxers/id3.c
@@ -60,7 +60,7 @@ static const char* const id3_genre[] =
"Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance",
"Dream", "Southern Rock", "Comedy", "Cult", "Gangsta",
"Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American",
- "Cabaret", "New Wave", "Psychadelic", "Rave", "Showtunes",
+ "Cabaret", "New Wave", "Psychedelic", "Rave", "Showtunes",
"Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz",
"Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock",
"Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion",
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index 1840dabf1..2028cd999 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -960,7 +960,7 @@ static int render_setup_fp_yuv (opengl_driver_t *this) {
glGetIntegerv (MYGL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
if (errorpos != -1)
xprintf (this->xine, XINE_VERBOSITY_NONE,
- "video_out_opengl: fragprog_yuv errorpos %d begining with '%.20s'. Ask a wizard.\n",
+ "video_out_opengl: fragprog_yuv errorpos %d beginning with '%.20s'. Ask a wizard.\n",
errorpos, fragprog_yuv+errorpos);
glEnable (MYGL_FRAGMENT_PROGRAM_ARB);
diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h
index 1d5852b09..7ea60bec9 100644
--- a/src/video_out/xxmc.h
+++ b/src/video_out/xxmc.h
@@ -77,11 +77,9 @@
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
+#include <X11/extensions/XvMClib.h>
#ifdef HAVE_VLDXVMC
#include <X11/extensions/vldXvMC.h>
-#else
- #include <X11/extensions/XvMClib.h>
- #include <X11/extensions/XvMC.h>
#endif
#define LOG_MODULE "video_out_xxmc"