summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-05-27 21:37:48 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-05-27 21:37:48 +0000
commitd6b75ef1f39e2cb8869d83656ac09e6cb1005117 (patch)
tree86ad32d2e1da97f4f597a36b0d2adfeb290f28bc
parentfe4128b60ee70f1aaa3f17080690cae46b020013 (diff)
downloadxine-lib-d6b75ef1f39e2cb8869d83656ac09e6cb1005117.tar.gz
xine-lib-d6b75ef1f39e2cb8869d83656ac09e6cb1005117.tar.bz2
fix flac time display
http://sourceforge.net/tracker/index.php?func=detail&aid=856495&group_id=9655&atid=109655 CVS patchset: 6600 CVS date: 2004/05/27 21:37:48
-rw-r--r--src/libflac/demux_flac.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libflac/demux_flac.c b/src/libflac/demux_flac.c
index 30fc0315f..8bc55ac6d 100644
--- a/src/libflac/demux_flac.c
+++ b/src/libflac/demux_flac.c
@@ -233,8 +233,8 @@ flac_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
this->bits_per_sample = metadata->data.stream_info.bits_per_sample;
this->channels = metadata->data.stream_info.channels;
this->sample_rate = metadata->data.stream_info.sample_rate;
- this->length_in_msec = (this->total_samples * 10 /
- (this->sample_rate / 100))/1000;
+ this->length_in_msec = (this->total_samples * 1000) /
+ this->sample_rate;
}
return;
}
@@ -283,11 +283,9 @@ demux_flac_send_chunk (demux_plugin_t *this_gen) {
- this->data_start;
current_pts = current_file_pos;
- current_pts *= 90000;
- if (this->sample_rate != 0)
- {
- current_pts /= this->sample_rate;
- }
+ current_pts *= this->length_in_msec * 90;
+ if( (this->data_size - this->data_start) > 0 )
+ current_pts /= (this->data_size - this->data_start);
if (this->seek_flag) {
_x_demux_control_newpts (this->stream, current_pts, 0);
@@ -304,7 +302,7 @@ demux_flac_send_chunk (demux_plugin_t *this_gen) {
buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
buf->type = BUF_AUDIO_FLAC;
buf->extra_info->input_pos = current_file_pos;
- buf->extra_info->input_length = this->data_size;
+ buf->extra_info->input_length = this->data_size - this->data_start;
buf->extra_info->input_time = current_pts / 90;
//buf->pts = current_pts;