From 7479544593aec1206994007d029b5fdfded04a41 Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Mon, 17 Nov 2003 05:42:07 +0000 Subject: compute the proper initial frame duration CVS patchset: 5758 CVS date: 2003/11/17 05:42:07 --- src/demuxers/demux_film.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index b03ca5130..b6de020aa 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.70 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_film.c,v 1.71 2003/11/17 05:42:07 tmmm Exp $ */ #ifdef HAVE_CONFIG_H @@ -655,6 +655,8 @@ static int demux_film_send_chunk(demux_plugin_t *this_gen) { static void demux_film_send_headers(demux_plugin_t *this_gen) { demux_film_t *this = (demux_film_t *) this_gen; buf_element_t *buf; + int64_t initial_duration = 3000; + int i; this->video_fifo = this->stream->video_fifo; this->audio_fifo = this->stream->audio_fifo; @@ -681,10 +683,17 @@ static void demux_film_send_headers(demux_plugin_t *this_gen) { /* send init info to decoders */ if (this->video_type) { + /* find the first video frame duration */ + for (i = 0; i < this->sample_count; i++) + if (!this->sample_table[i].audio) { + initial_duration = this->sample_table[i].duration; + break; + } + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->decoder_flags = BUF_FLAG_HEADER; buf->decoder_info[0] = 0; - buf->decoder_info[1] = 3000; /* initial video_step */ + buf->decoder_info[1] = initial_duration; memcpy(buf->content, &this->bih, sizeof(this->bih)); buf->size = sizeof(this->bih); buf->type = this->video_type; -- cgit v1.2.3