diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_file_out.c | 16 | ||||
-rw-r--r-- | src/audio_out/audio_jack_out.c | 5 | ||||
-rw-r--r-- | src/audio_out/audio_pulse_out.c | 3 | ||||
-rw-r--r-- | src/demuxers/asfheader.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_asf.c | 18 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 6 | ||||
-rw-r--r-- | src/demuxers/demux_iff.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_matroska.c | 13 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_pes.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_ogg.c | 31 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_wc3movie.c | 3 |
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 802461e0e..bc40d4efd 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 a343310f0..1fadb3a13 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 ae74a57bc..93e134785 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/demuxers/asfheader.c b/src/demuxers/asfheader.c index 7a1397d73..5b309b76b 100644 --- a/src/demuxers/asfheader.c +++ b/src/demuxers/asfheader.c @@ -358,7 +358,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;
@@ -532,7 +532,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 1250ba9a5..d2f0a89de 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -513,13 +513,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) */ @@ -998,8 +998,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; @@ -1038,8 +1040,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); @@ -1581,11 +1585,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")) { @@ -1641,9 +1645,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 */ @@ -1661,9 +1667,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 100828bd2..79bfc9f12 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 1785e86d7..fb7d1c748 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 3d1935587..242293502 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -1846,7 +1846,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; @@ -1866,7 +1866,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);*/ @@ -2049,6 +2049,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, @@ -2070,7 +2077,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; @@ -2085,7 +2091,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 aa5294e8b..08655ada9 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -868,6 +868,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; @@ -875,6 +876,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 @@ -882,6 +884,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]; @@ -906,6 +909,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 9ef7221f0..305069b3c 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -975,6 +975,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; @@ -982,13 +983,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]; @@ -1019,6 +1021,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_ogg.c b/src/demuxers/demux_ogg.c index e0abd0cd6..8849e445e 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -931,21 +931,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]); @@ -1014,18 +1020,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/demux_real.c b/src/demuxers/demux_real.c index 2b14a4207..9ecf6b622 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 36cc4eabb..3b310e90c 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); |