summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_pulse_out.c5
-rw-r--r--src/combined/wavpack_demuxer.c2
-rw-r--r--src/demuxers/demux_flac.c2
-rw-r--r--src/demuxers/demux_matroska.c14
-rw-r--r--src/demuxers/id3.c5
-rw-r--r--src/video_out/video_out_xcbxv.c33
-rw-r--r--src/video_out/video_out_xv.c28
7 files changed, 82 insertions, 7 deletions
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index b4ec0b156..0235a4321 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -246,7 +246,7 @@ static int ao_pulse_open(ao_driver_t *this_gen,
pa_threaded_mainloop_lock(this->pa_class->mainloop);
ret = pa_context_connect(this->pa_class->context, this->host, 1, NULL);
if ( ret < 0 )
- goto fail;
+ goto fail_unlock;
pa_context_set_state_callback(this->pa_class->context, __xine_pa_context_status_callback, this);
@@ -289,8 +289,9 @@ static int ao_pulse_open(ao_driver_t *this_gen,
return this->sample_rate;
-fail:
+ fail_unlock:
pa_threaded_mainloop_unlock(this->pa_class->mainloop);
+ fail:
this_gen->close(this_gen);
return 0;
}
diff --git a/src/combined/wavpack_demuxer.c b/src/combined/wavpack_demuxer.c
index 9c0831cfa..403d136d1 100644
--- a/src/combined/wavpack_demuxer.c
+++ b/src/combined/wavpack_demuxer.c
@@ -368,7 +368,7 @@ void *demux_wv_init_plugin (xine_t *const xine, void *const data) {
this->demux_class.open_plugin = open_plugin;
this->demux_class.description = N_("Wavpack demux plugin");
this->demux_class.identifier = "Wavpack";
- this->demux_class.mimetypes = NULL;
+ this->demux_class.mimetypes = "audio/x-wavpack";
this->demux_class.extensions = "wv";
this->demux_class.dispose = default_demux_class_dispose;
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c
index 2e84eb4b7..ed974a69c 100644
--- a/src/demuxers/demux_flac.c
+++ b/src/demuxers/demux_flac.c
@@ -201,7 +201,7 @@ static int open_flac_file(demux_flac_t *flac) {
length = _X_LE_32(ptr);
ptr += 4 + length;
- if (length >= block_length - 8)
+ if (length > block_length - 8)
return 0; /* bad length or too little left in the buffer */
user_comment_list_length = _X_LE_32(ptr);
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index ae71923d6..ec932aacb 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -1833,6 +1833,15 @@ static int read_block_data (demux_matroska_t *this, int len) {
return 1;
}
+static int parse_int16(uint8_t *data) {
+ int value = (int)_X_BE_16(data);
+ if (value & 1<<15)
+ {
+ value -= 1<<16;
+ }
+ return value;
+}
+
static int parse_block (demux_matroska_t *this, uint64_t block_size,
uint64_t cluster_timecode, uint64_t block_duration,
int normpos, int is_key) {
@@ -1849,8 +1858,9 @@ static int parse_block (demux_matroska_t *this, uint64_t block_size,
if (!(num_len = parse_ebml_uint(this, data, &track_num)))
return 0;
data += num_len;
-
- timecode_diff = (int)_X_BE_16(data);
+
+ /* timecode_diff is signed */
+ timecode_diff = parse_int16(data);
data += 2;
flags = *data;
diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c
index f65d5564c..71cb5e743 100644
--- a/src/demuxers/id3.c
+++ b/src/demuxers/id3.c
@@ -543,6 +543,7 @@ int id3v23_parse_tag(input_plugin_t *input,
if (!id3v23_parse_frame_ext_header(input, &tag_frame_ext_header)) {
return 0;
}
+ pos += tag_frame_ext_header.size;
}
/* frame parsing */
while ((pos + ID3V23_FRAME_HEADER_SIZE) <= tag_header.size) {
@@ -563,7 +564,8 @@ int id3v23_parse_tag(input_plugin_t *input,
pos += tag_frame_header.size;
} else {
/* end of frames, the rest is padding */
- input->seek (input, tag_header.size - pos, SEEK_CUR);
+ lprintf("skipping padding %d bytes\n", tag_header.size - pos);
+ input->seek (input, tag_header.size - pos, SEEK_CUR);
return 1;
}
} else {
@@ -785,6 +787,7 @@ int id3v24_parse_tag(input_plugin_t *input,
if (!id3v24_parse_ext_header(input, &tag_frame_ext_header)) {
return 0;
}
+ pos += tag_frame_ext_header.size;
}
/* frame parsing */
while ((pos + ID3V24_FRAME_HEADER_SIZE) <= tag_header.size) {
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index 204f59c2c..d77917a70 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -1086,6 +1086,27 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
LOG_MODULE ": double buffering mode = %d\n", xv_double_buffer);
}
+static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_driver_t *this = (xv_driver_t *) this_gen;
+ int xv_sync_to_vblank;
+
+ xcb_intern_atom_cookie_t atom_cookie;
+ xcb_intern_atom_reply_t *atom_reply;
+
+ xv_sync_to_vblank = entry->num_value;
+
+ pthread_mutex_lock(&this->main_mutex);
+ atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_SYNC_TO_VBLANK"), "XV_SYNC_TO_VBLANK");
+ atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL);
+ xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_sync_to_vblank);
+ free(atom_reply);
+ pthread_mutex_unlock(&this->main_mutex);
+
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "video_out_xcbxv: sync to vblank = %d\n", xv_sync_to_vblank);
+}
+
+
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1342,6 +1363,18 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP,
20, xv_update_XV_DOUBLE_BUFFER, this);
config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer);
+ } else if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_SYNC_TO_VBLANK")) {
+ int xv_sync_to_vblank;
+ xv_sync_to_vblank =
+ config->register_bool (config, "video.device.xv_sync_to_vblank", 1,
+ _("enable vblank sync"),
+ _("This option will synchronize the update of the video image to the "
+ "repainting of the entire screen (\"vertical retrace\"). This eliminates "
+ "flickering and tearing artifacts. On nvidia cards one may also "
+ "need to run \"nvidia-settings\" and choose which display device to "
+ "sync to under the XVideo Settings tab"),
+ 20, xv_update_XV_SYNC_TO_VBLANK, this);
+ config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank);
}
}
}
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index bc5928c25..a874e4cdf 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -1130,6 +1130,22 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
LOG_MODULE ": double buffering mode = %d\n", xv_double_buffer);
}
+static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_driver_t *this = (xv_driver_t *) this_gen;
+ Atom atom;
+ int xv_sync_to_vblank;
+
+ xv_sync_to_vblank = entry->num_value;
+
+ LOCK_DISPLAY(this);
+ atom = XInternAtom (this->display, "XV_SYNC_TO_VBLANK", False);
+ XvSetPortAttribute (this->display, this->xv_port, atom, xv_sync_to_vblank);
+ UNLOCK_DISPLAY(this);
+
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "video_out_xv: sync to vblank = %d\n", xv_sync_to_vblank);
+}
+
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1390,6 +1406,18 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP,
20, xv_update_XV_DOUBLE_BUFFER, this);
config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer);
+ } else if(!strcmp(attr[k].name, "XV_SYNC_TO_VBLANK")) {
+ int xv_sync_to_vblank;
+ xv_sync_to_vblank =
+ config->register_bool (config, "video.device.xv_sync_to_vblank", 1,
+ _("enable vblank sync"),
+ _("This option will synchronize the update of the video image to the "
+ "repainting of the entire screen (\"vertical retrace\"). This eliminates "
+ "flickering and tearing artifacts. On nvidia cards one may also "
+ "need to run \"nvidia-settings\" and choose which display device to "
+ "sync to under the XVideo Settings tab"),
+ 20, xv_update_XV_SYNC_TO_VBLANK, this);
+ config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank);
}
}
}