[prev in list] [next in list] [prev in thread] [next in thread]
List: xine-devel
Subject: [xine-devel] [PATCH] demux_tta: fix some dumb truncation errors
From: Kelvie Wong <kelvie () ieee ! org>
Date: 2010-04-02 8:42:15
Message-ID: 090442949bc5dee6caac.1270197735 () gargantua
[Download RAW message or body]
# HG changeset patch
# User Kelvie Wong <kelvie@ieee.org>
# Date 1270197727 25200
# Node ID 090442949bc5dee6caac9d22a8e2122919d8ae42
# Parent d6be8016080ea5fbfc056be8e7fe81543375e90e
demux_tta: fix some dumb truncation errors
I don't know why I multiplied by integers _outside_ the parentheses. I blame
late nights.
Regardless, this fixes the skip every 24 seconds due to the truncation of
FRAME_TIME. The input_time is also more accurate for e.g. stopping cue tracks.
diff -r d6be8016080e -r 090442949bc5 src/demuxers/demux_tta.c
--- a/src/demuxers/demux_tta.c Tue Mar 30 19:00:39 2010 +0100
+++ b/src/demuxers/demux_tta.c Fri Apr 02 01:42:07 2010 -0700
@@ -129,7 +129,7 @@
/* Get a buffer */
buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo);
buf->type = BUF_AUDIO_TTA;
- buf->pts = (int64_t)(FRAME_TIME * this->currentframe) * 90000;
+ buf->pts = (int64_t)(FRAME_TIME * this->currentframe * 90000);
buf->extra_info->total_time = (int)(le2me_32(this->header.tta.data_length) * \
1000.0 / le2me_32(this->header.tta.samplerate)); /* milliseconds */ \
buf->decoder_flags = 0;
@@ -138,7 +138,7 @@
(int) ((double) this->currentframe * 65535 / this->totalframes);
/* Set time */
- buf->extra_info->input_time = (int)(FRAME_TIME * this->currentframe)*1000;
+ buf->extra_info->input_time = (int)(FRAME_TIME * this->currentframe * 1000);
bytes_read = this->input->read(this->input, buf->content, ( bytes_to_read > \
buf->max_size ) ? buf->max_size : bytes_to_read); if (bytes_read < 0) {
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
xine-devel mailing list
xine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic