summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_file_out.c16
-rw-r--r--src/audio_out/audio_jack_out.c5
-rw-r--r--src/audio_out/audio_pulse_out.c3
-rw-r--r--src/combined/xine_ogg_demuxer.c31
-rw-r--r--src/demuxers/asfheader.c4
-rw-r--r--src/demuxers/demux_asf.c18
-rw-r--r--src/demuxers/demux_avi.c6
-rw-r--r--src/demuxers/demux_iff.c2
-rw-r--r--src/demuxers/demux_matroska.c13
-rw-r--r--src/demuxers/demux_mpeg_block.c4
-rw-r--r--src/demuxers/demux_mpeg_pes.c5
-rw-r--r--src/demuxers/demux_real.c2
-rw-r--r--src/demuxers/demux_wc3movie.c3
13 files changed, 73 insertions, 39 deletions
diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c
index 4f4e6bc47..0a4471a19 100644
--- a/src/audio_out/audio_file_out.c
+++ b/src/audio_out/audio_file_out.c
@@ -274,10 +274,20 @@ static void ao_file_close(ao_driver_t *this_gen)
this->fname, this->bytes_written / 1024);
if (lseek(this->fd, 40, SEEK_SET) != -1) {
- write(this->fd, &len, 4);
+ if (write(this->fd, &len, 4) != 4) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_file_out: Failed to write header to file '%s': %s\n",
+ this->fname, strerror(errno));
+ }
+
len = le2me_32(this->bytes_written + 0x24);
- if (lseek(this->fd, 4, SEEK_SET) != -1)
- write(this->fd, &len, 4);
+ if (lseek(this->fd, 4, SEEK_SET) != -1) {
+ if (write(this->fd, &len, 4) != 4) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "audio_file_out: Failed to write header to file '%s': %s\n",
+ this->fname, strerror(errno));
+ }
+ }
+
}
close(this->fd);
diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c
index eca1263ed..975a5f38a 100644
--- a/src/audio_out/audio_jack_out.c
+++ b/src/audio_out/audio_jack_out.c
@@ -278,12 +278,13 @@ static int jack_callback (jack_nframes_t nframes, void *arg)
return 0;
}
-
+#if 0
static void jack_shutdown (void *arg)
{
jack_driver_t *this = (jack_driver_t *) arg;
this->client = NULL;
}
+#endif
/*
* Open the Jack audio device
@@ -295,7 +296,6 @@ static int jack_open_device (ao_driver_t *this_gen, char *jack_device,
{
jack_driver_t *this = (jack_driver_t *) this_gen;
const char **matching_ports = NULL;
- char *port_name = NULL;
jack_client_t *client = this->client;
int port_flags = JackPortIsInput;
@@ -686,7 +686,6 @@ static ao_driver_t *open_jack_plugin (audio_driver_class_t *class_gen,
uint32_t rate;
char *jack_device;
const char **matching_ports = NULL;
- const char **port_names;
/* for usability reasons, keep this in sync with audio_oss_out.c */
static char *speaker_arrangement[] = {
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index bd057501b..5370389c7 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -360,7 +360,6 @@ static int ao_pulse_open(ao_driver_t *this_gen,
pulse_driver_t *this = (pulse_driver_t *) this_gen;
pa_sample_spec ss;
pa_channel_map cm;
- int r;
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
"audio_pulse_out: ao_open bits=%d rate=%d, mode=%d\n", bits, rate, mode);
@@ -466,7 +465,7 @@ static int ao_pulse_open(ao_driver_t *this_gen,
pa_stream_set_write_callback(this->stream, __xine_pa_stream_request_callback, this);
pa_stream_set_latency_update_callback(this->stream, __xine_pa_stream_notify_callback, this);
- r = pa_stream_connect_playback(this->stream, this->sink, NULL,
+ pa_stream_connect_playback(this->stream, this->sink, NULL,
PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE,
NULL, NULL);
diff --git a/src/combined/xine_ogg_demuxer.c b/src/combined/xine_ogg_demuxer.c
index e297339df..d8fae78f7 100644
--- a/src/combined/xine_ogg_demuxer.c
+++ b/src/combined/xine_ogg_demuxer.c
@@ -940,21 +940,27 @@ static void decode_video_header (demux_ogg_t *this, const int stream_num, ogg_pa
xine_bmiheader bih;
int channel;
+#ifdef LOG
int16_t locbits_per_sample;
+ int32_t locsize, locdefault_len, locbuffersize;
+ int64_t locsamples_per_unit;
+#endif
uint32_t locsubtype;
- int32_t locsize, locdefault_len, locbuffersize, locwidth, locheight;
- int64_t loctime_unit, locsamples_per_unit;
+ int32_t locwidth, locheight;
+ int64_t loctime_unit;
/* read fourcc with machine endianness */
locsubtype = *((uint32_t *)&op->packet[9]);
/* everything else little endian */
- locsize = _X_LE_32(&op->packet[13]);
loctime_unit = _X_LE_64(&op->packet[17]);
+#ifdef LOG
+ locsize = _X_LE_32(&op->packet[13]);
locsamples_per_unit = _X_LE_64(&op->packet[25]);
locdefault_len = _X_LE_32(&op->packet[33]);
locbuffersize = _X_LE_32(&op->packet[37]);
locbits_per_sample = _X_LE_16(&op->packet[41]);
+#endif
locwidth = _X_LE_32(&op->packet[45]);
locheight = _X_LE_32(&op->packet[49]);
@@ -1026,18 +1032,25 @@ static void decode_audio_header (demux_ogg_t *this, const int stream_num, ogg_pa
char str[5];
int channel;
- int16_t locbits_per_sample, locchannels, locblockalign;
- int32_t locsize, locdefault_len, locbuffersize, locavgbytespersec;
- int64_t loctime_unit, locsamples_per_unit;
+#ifdef LOG
+ int16_t locblockalign;
+ int32_t locsize, locdefault_len, locbuffersize;
+ int64_t loctime_unit;
+#endif
+ int16_t locbits_per_sample, locchannels;
+ int32_t locavgbytespersec;
+ int64_t locsamples_per_unit;
+#ifdef LOG
locsize = _X_LE_32(&op->packet[13]);
loctime_unit = _X_LE_64(&op->packet[17]);
- locsamples_per_unit = _X_LE_64(&op->packet[25]);
- locdefault_len = _X_LE_32(&op->packet[33]);
locbuffersize = _X_LE_32(&op->packet[37]);
+ locdefault_len = _X_LE_32(&op->packet[33]);
+ locblockalign = _X_LE_16(&op->packet[47]);
+#endif
+ locsamples_per_unit = _X_LE_64(&op->packet[25]);
locbits_per_sample = _X_LE_16(&op->packet[41]);
locchannels = _X_LE_16(&op->packet[45]);
- locblockalign = _X_LE_16(&op->packet[47]);
locavgbytespersec= _X_LE_32(&op->packet[49]);
lprintf ("direct show filter created audio stream detected, hexdump:\n");
diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c
index a78c84fd2..9810aead9 100644
--- a/src/demuxers/asfheader.c
+++ b/src/demuxers/asfheader.c
@@ -354,7 +354,7 @@ exit_error:
static int asf_header_parse_stream_extended_properties(asf_header_t *header, uint8_t *buffer, int buffer_len) {
asf_reader_t reader;
uint32_t flags = 0;
- uint16_t stream_number;
+ uint16_t stream_number = 0;
int i;
int stream_id;
asf_stream_extension_t *asf_stream_extension;
@@ -527,7 +527,7 @@ static int asf_header_parse_metadata(asf_header_t *header_pub, uint8_t *buffer,
for (i = 0; i < records_count; i++)
{
- uint16_t index, stream, name_len = 0, data_type;
+ uint16_t index, stream = 0, name_len = 0, data_type;
uint32_t data_len = 0;
int stream_id;
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 186caa2fe..b33c83b18 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -512,13 +512,13 @@ static int asf_read_header (demux_asf_t *this) {
* XX bytes : optional palette
*/
uint32_t width, height;
- uint16_t bmiheader_size;
+ /*uint16_t bmiheader_size;*/
xine_bmiheader *bmiheader;
width = _X_LE_32(asf_stream->private_data);
height = _X_LE_32(asf_stream->private_data + 4);
/* there is one unknown byte between height and the bmiheader size */
- bmiheader_size = _X_LE_16(asf_stream->private_data + 9);
+ /*bmiheader_size = _X_LE_16(asf_stream->private_data + 9);*/
/* FIXME: bmiheader_size must be >= sizeof(xine_bmiheader) */
@@ -994,8 +994,10 @@ static int asf_parse_packet_ecd(demux_asf_t *this, uint32_t *p_hdr_size) {
/* return 0 if ok */
static int asf_parse_packet_payload_header(demux_asf_t *this, uint32_t p_hdr_size) {
+#ifdef LOG
int64_t timestamp;
int64_t duration;
+#endif
this->packet_len_flags = get_byte(this); p_hdr_size += 1;
this->packet_prop_flags = get_byte(this); p_hdr_size += 1;
@@ -1034,8 +1036,10 @@ static int asf_parse_packet_payload_header(demux_asf_t *this, uint32_t p_hdr_siz
this->packet_padsize = 0;
}
+#ifdef LOG
timestamp = get_le32(this); p_hdr_size += 4;
duration = get_le16(this); p_hdr_size += 2;
+#endif
lprintf ("timestamp=%"PRId64", duration=%"PRId64"\n", timestamp, duration);
@@ -1577,11 +1581,11 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) {
ENTRYREF, MOREINFO, PARAM, REPEAT, TITLE
*/
- const char *base_href = NULL;
+ /*const char *base_href = NULL;*/
for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next)
{
- const char *ref_base_href = base_href;
+ /*const char *ref_base_href = base_href;*/
if (!strcasecmp (asx_entry->name, "ENTRY"))
{
@@ -1637,9 +1641,11 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) {
duration = asx_get_time_value (asx_ref);
}
+#if 0
else if (!strcasecmp (asx_ref->name, "BASE"))
/* Attributes: HREF */
- ref_base_href = xml_parser_get_property (asx_entry, "HREF");
+ ref_base_href = xml_parser_get_property (asx_entry, "HREF");
+#endif
}
/* FIXME: prepend ref_base_href to href */
@@ -1657,9 +1663,11 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) {
_x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1);
}
+#if 0
else if (!strcasecmp (asx_entry->name, "BASE"))
/* Attributes: HREF */
base_href = xml_parser_get_property (asx_entry, "HREF");
+#endif
}
}
else
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index af1c0aa7f..ae97b576e 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -732,8 +732,6 @@ static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) {
int lasttag = 0;
int vids_strh_seen = 0;
int vids_strf_seen = 0;
- int auds_strh_seen = 0;
- int auds_strf_seen = 0;
int num_stream = 0;
uint8_t data[256];
int strf_size;
@@ -898,7 +896,6 @@ static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) {
a->dwSampleSize = _X_LE_32(hdrl_data + i + 44);
a->audio_tot = 0;
- auds_strh_seen = 1;
lprintf("audio stream header, num_stream=%d\n", num_stream);
lasttag = 2; /* auds */
@@ -985,7 +982,6 @@ static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) {
AVI->audio[AVI->n_audio-1]->wavex = wavex;
AVI->audio[AVI->n_audio-1]->wavex_len = n;
lprintf("audio stream format\n");
- auds_strf_seen = 1;
}
} else if(strncasecmp(hdrl_data + i, "indx",4) == 0) {
@@ -1712,7 +1708,7 @@ static int demux_avi_next_streaming (demux_avi_t *this, int decoder_flags) {
int64_t audio_pts, video_pts;
off_t current_pos;
int left;
- int header, chunk_len, audio_stream;
+ int header, chunk_len = 0, audio_stream;
avi_audio_t *audio;
current_pos = this->input->get_current_pos(this->input);
diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c
index 67392617b..f199723e1 100644
--- a/src/demuxers/demux_iff.c
+++ b/src/demuxers/demux_iff.c
@@ -689,7 +689,6 @@ static int demux_iff_send_chunk(demux_plugin_t *this_gen) {
int64_t zw_pts;
int64_t zw_rescale;
int j, k;
- int first_buf;
int interleave_index;
int size;
@@ -791,7 +790,6 @@ static int demux_iff_send_chunk(demux_plugin_t *this_gen) {
interleave_index = (current_file_pos *
this->audio_compression_factor);
}
- first_buf = 1;
zw_pts = current_file_pos;
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index f9f0b23d5..32feacf28 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -1847,7 +1847,7 @@ static int parse_block (demux_matroska_t *this, size_t block_size,
uint64_t track_num;
uint8_t *data;
uint8_t flags;
- int gap, lacing, num_len;
+ int lacing, num_len;
int16_t timecode_diff;
int64_t pts, xduration;
int decoder_flags = 0;
@@ -1867,7 +1867,7 @@ static int parse_block (demux_matroska_t *this, size_t block_size,
lprintf("track_num: %" PRIu64 ", timecode_diff: %d, flags: 0x%x\n", track_num, timecode_diff, flags);
- gap = flags & 1;
+ /*gap = flags & 1;*/
lacing = (flags >> 1) & 0x3;
/*fprintf(stderr, "lacing: %x\n", lacing);*/
@@ -2050,6 +2050,13 @@ static int parse_block (demux_matroska_t *this, size_t block_size,
}
/* send each frame to the decoder */
for (i = 0; i <= lace_num; i++) {
+
+ if (headers_len) {
+ data -= headers_len;
+ xine_fast_memcpy(data, track->compress_settings, headers_len);
+ frame[i] += headers_len;
+ }
+
if (track->handle_content != NULL) {
track->handle_content((demux_plugin_t *)this, track,
decoder_flags,
@@ -2071,7 +2078,6 @@ static int parse_block (demux_matroska_t *this, size_t block_size,
static int parse_simpleblock(demux_matroska_t *this, size_t block_len, uint64_t cluster_timecode, uint64_t block_duration)
{
- int has_block = 0;
off_t block_pos = 0;
off_t file_len = 0;
int normpos = 0;
@@ -2086,7 +2092,6 @@ static int parse_simpleblock(demux_matroska_t *this, size_t block_len, uint64_t
if (!read_block_data(this, block_len, this->compress_maxlen))
return 0;
- has_block = 1;
/* we have the duration, we can parse the block now */
if (!parse_block(this, block_len, cluster_timecode, block_duration,
normpos, is_key))
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 5d00742e5..cad841456 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.c
@@ -874,6 +874,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
} else if ((p[0]&0xf0) == 0xa0) {
int pcm_offset;
+#if 0
int number_of_frame_headers;
int first_access_unit_pointer;
int audio_frame_number;
@@ -881,6 +882,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
int sample_rate;
int num_channels;
int dynamic_range;
+#endif
/*
* found in http://members.freemail.absa.co.za/ginggs/dvd/mpeg2_lpcm.txt
@@ -888,6 +890,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
*/
track = p[0] & 0x0F;
+#if 0
number_of_frame_headers = p[1];
/* unknown = p[2]; */
first_access_unit_pointer = p[3];
@@ -912,6 +915,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
case 2: bits_per_sample = 24; break;
}
dynamic_range = p[6];
+#endif
/* send lpcm config byte */
buf->decoder_flags |= BUF_FLAG_SPECIAL;
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index 8d1f4b8af..4d53b6d34 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_pes.c
@@ -980,6 +980,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
} else if ((p[0]&0xf0) == 0xa0) {
int pcm_offset;
+#if 0
int number_of_frame_headers;
int first_access_unit_pointer;
int audio_frame_number;
@@ -987,13 +988,14 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
int sample_rate;
int num_channels;
int dynamic_range;
-
+#endif
/*
* found in http://members.freemail.absa.co.za/ginggs/dvd/mpeg2_lpcm.txt
* appears to be correct.
*/
track = p[0] & 0x0F;
+#if 0
number_of_frame_headers = p[1];
/* unknown = p[2]; */
first_access_unit_pointer = p[3];
@@ -1024,6 +1026,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
case 2: bits_per_sample = 24; break;
}
dynamic_range = p[6];
+#endif
/* send lpcm config byte */
buf->decoder_flags |= BUF_FLAG_SPECIAL;
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index b1e884a45..47d18018e 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -1251,7 +1251,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) {
buf->size = 0;
buf->type = this->video_stream->buf_type;
- xine_fast_memcpy(buf->decoder_info_ptr[2], this->fragment_tab,
+ xine_fast_memcpy(buf->content, this->fragment_tab,
this->fragment_count*8);
this->video_fifo->put(this->video_fifo, buf);
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index fbf2a7ce0..db115fe07 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -141,7 +141,6 @@ static int demux_mve_send_chunk(demux_plugin_t *this_gen) {
demux_mve_t *this = (demux_mve_t *) this_gen;
buf_element_t *buf = NULL;
- int64_t text_pts = 0;
int64_t audio_pts = 0;
unsigned char preamble[PREAMBLE_SIZE];
unsigned int chunk_tag;
@@ -264,7 +263,7 @@ static int demux_mve_send_chunk(demux_plugin_t *this_gen) {
}
this->video_pts += WC3_PTS_INC;
} else if (chunk_tag == TEXT_TAG) {
- text_pts = this->video_pts - WC3_PTS_INC;
+ /*text_pts = this->video_pts - WC3_PTS_INC;*/
/* unhandled thus far */
this->input->seek(this->input, chunk_size, SEEK_CUR);