summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2002-09-28 22:47:01 +0000
committerMike Melanson <mike@multimedia.cx>2002-09-28 22:47:01 +0000
commit9ee0bd378dd61c08d4e7bbd82cb47c697011e72c (patch)
tree09517b465a3795065001c1cf82585e80c91af0cd /src
parentf27ce63b38a501d356a5b0be1dfb32aef6df4f0a (diff)
downloadxine-lib-9ee0bd378dd61c08d4e7bbd82cb47c697011e72c.tar.gz
xine-lib-9ee0bd378dd61c08d4e7bbd82cb47c697011e72c.tar.bz2
eliminate separate pts counter for audio; this makes pts handling
cleaner and also clears up some audio pops at the start of a file CVS patchset: 2757 CVS date: 2002/09/28 22:47:01
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_wc3movie.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index 5330def98..75d2797ef 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -22,7 +22,7 @@
* For more information on the MVE file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_wc3movie.c,v 1.9 2002/09/28 22:06:31 tmmm Exp $
+ * $Id: demux_wc3movie.c,v 1.10 2002/09/28 22:47:01 tmmm Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -156,13 +156,12 @@ static void *demux_mve_loop (void *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;
int64_t video_pts = 0;
unsigned char preamble[PREAMBLE_SIZE];
unsigned int chunk_tag;
unsigned int chunk_size;
- unsigned int audio_frames;
- uint64_t total_frames = 0;
off_t current_file_pos;
unsigned int palette_number;
@@ -199,7 +198,7 @@ static void *demux_mve_loop (void *this_gen) {
if (this->seek_flag) {
/* reset pts */
- video_pts = total_frames = 0;
+ video_pts = 0;
xine_demux_control_newpts(this->xine, 0, BUF_FLAG_SEEK);
this->seek_flag = 0;
@@ -239,13 +238,7 @@ static void *demux_mve_loop (void *this_gen) {
} else if (chunk_tag == AUDI_TAG) {
- audio_frames =
- chunk_size * 8 / this->wave.wBitsPerSample /
- this->wave.nChannels;
- total_frames += audio_frames;
- audio_pts = total_frames;
- audio_pts *= 90000;
- audio_pts /= this->wave.nSamplesPerSec;
+ audio_pts = video_pts - WC3_PTS_INC;
while (chunk_size) {
buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
@@ -306,6 +299,8 @@ static void *demux_mve_loop (void *this_gen) {
} else if (chunk_tag == TEXT_TAG) {
+ text_pts = video_pts - WC3_PTS_INC;
+
/* unhandled thus far */
this->input->seek(this->input, chunk_size, SEEK_CUR);