From 40d1d7b20811be941b36d9067a8a7be2d28c1039 Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Tue, 27 May 2003 03:39:52 +0000 Subject: play the NSV file even when the NSVf metadata chunk is not present CVS patchset: 4961 CVS date: 2003/05/27 03:39:52 --- src/demuxers/demux_nsv.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index fb2abd252..c0b61c28d 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -21,7 +21,7 @@ * For more information regarding the NSV file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_nsv.c,v 1.1 2003/05/19 21:59:46 tmmm Exp $ + * $Id: demux_nsv.c,v 1.2 2003/05/27 03:39:52 tmmm Exp $ */ #ifdef HAVE_CONFIG_H @@ -140,6 +140,8 @@ static int open_nsv_file(demux_nsv_t *this) { this->input->seek(this->input, 4, SEEK_SET); } + this->data_size = this->input->get_length(this->input); + if (BE_32(&preview[0]) == NSVf_TAG) { /* if there is a NSVs tag, load 24 more header bytes; load starting at @@ -153,19 +155,20 @@ static int open_nsv_file(demux_nsv_t *this) { /* skip the rest of the data */ this->input->seek(this->input, LE_32(&preview[4]) - 28, SEEK_CUR); + /* get the first 4 bytes of the next chunk */ + if (this->input->read(this->input, preview, 4) != 4) + return 0; } - this->data_size = this->input->get_length(this->input); - - /* fetch the 16 header bytes of the first chunk to get the relevant - * information */ - if (this->input->read(this->input, preview, 16) != 16) - return 0; - /* make sure it is a 'NSVs' chunk */ if (preview[3] != 's') return 0; + /* fetch the remaining 12 header bytes of the first chunk to get the + * relevant information */ + if (this->input->read(this->input, &preview[4], 12) != 12) + return 0; + this->video_fourcc = ME_32(&preview[4]); if (BE_32(&preview[4]) == NONE_TAG) this->video_type = 0; @@ -268,6 +271,11 @@ static int demux_nsv_send_chunk(demux_plugin_t *this_gen) { this->frame_pts_inc = 3003; break; + case 3: + /* 23.976 fps */ + this->frame_pts_inc = 3753; + break; + case 5: /* 14.98 fps */ this->frame_pts_inc = 6006; -- cgit v1.2.3