diff options
Diffstat (limited to 'src/demuxers/demux_roq.c')
-rw-r--r-- | src/demuxers/demux_roq.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index df2fb76a5..346d487aa 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -92,11 +92,11 @@ static int open_roq_file(demux_roq_t *this) { return 0; /* check for the RoQ magic numbers */ - static const uint8_t RoQ_MAGIC_STRING[] = + static const uint8_t RoQ_MAGIC_STRING[] = { 0x10, 0x84, 0xFF, 0xFF, 0xFF, 0xFF }; if( memcmp(preamble, RoQ_MAGIC_STRING, sizeof(RoQ_MAGIC_STRING)) != 0 ) return 0; - + this->bih.biSize = sizeof(xine_bmiheader); this->bih.biWidth = this->bih.biHeight = 0; this->wave.nChannels = 0; /* assume no audio at first */ @@ -119,7 +119,7 @@ static int open_roq_file(demux_roq_t *this) { while (i-- > 0) { /* if this read fails, then maybe it's just a really small RoQ file * (even less than 2 seconds) */ - if (this->input->read(this->input, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != + if (this->input->read(this->input, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) break; chunk_type = _X_LE_16(&preamble[0]); @@ -181,7 +181,7 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) { off_t current_file_pos; /* fetch the next preamble */ - if (this->input->read(this->input, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != + if (this->input->read(this->input, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) { this->status = DEMUX_FINISHED; return this->status; @@ -193,21 +193,21 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) { if ((chunk_type == RoQ_SOUND_MONO) || (chunk_type == RoQ_SOUND_STEREO)) { if( this->audio_fifo ) { - + /* do this calculation carefully because I can't trust the * 64-bit numerical manipulation */ audio_pts = this->audio_byte_count; audio_pts *= 90000; audio_pts /= (RoQ_AUDIO_SAMPLE_RATE * this->wave.nChannels); this->audio_byte_count += chunk_size - 8; /* do not count the preamble */ - + current_file_pos = this->input->get_current_pos(this->input); /* send out the preamble */ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_ROQ; if( this->input->get_length (this->input) ) - buf->extra_info->input_normpos = (int)( (double) (current_file_pos - RoQ_CHUNK_PREAMBLE_SIZE) * + buf->extra_info->input_normpos = (int)( (double) (current_file_pos - RoQ_CHUNK_PREAMBLE_SIZE) * 65535 / this->input->get_length (this->input) ); buf->pts = 0; buf->size = RoQ_CHUNK_PREAMBLE_SIZE; @@ -219,7 +219,7 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) { buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_ROQ; if( this->input->get_length (this->input) ) - buf->extra_info->input_normpos = (int)( (double) current_file_pos * + buf->extra_info->input_normpos = (int)( (double) current_file_pos * 65535 / this->input->get_length (this->input) ); buf->pts = audio_pts; @@ -256,7 +256,7 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) { buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_VIDEO_ROQ; if( this->input->get_length (this->input) ) - buf->extra_info->input_normpos = (int)( (double) (current_file_pos - RoQ_CHUNK_PREAMBLE_SIZE) * + buf->extra_info->input_normpos = (int)( (double) (current_file_pos - RoQ_CHUNK_PREAMBLE_SIZE) * 65535 / this->input->get_length (this->input) ); buf->pts = this->video_pts_counter; buf->size = RoQ_CHUNK_PREAMBLE_SIZE; @@ -267,7 +267,7 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) { buf = this->video_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_VIDEO_ROQ; if( this->input->get_length (this->input) ) - buf->extra_info->input_normpos = (int)( (double) current_file_pos * + buf->extra_info->input_normpos = (int)( (double) current_file_pos * 65535 / this->input->get_length (this->input) ); buf->pts = this->video_pts_counter; |