From: Miguel F. <mig...@us...> - 2004-05-27 21:38:00
|
Update of /cvsroot/xine/xine-lib/src/libflac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27271 Modified Files: demux_flac.c Log Message: fix flac time display http://sourceforge.net/tracker/index.php?func=detail&aid=856495&group_id=9655&atid=109655 Index: demux_flac.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libflac/demux_flac.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- demux_flac.c 9 Jan 2004 01:26:33 -0000 1.16 +++ demux_flac.c 27 May 2004 21:37:48 -0000 1.17 @@ -233,8 +233,8 @@ 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 @@ - 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 @@ 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; |