ignore preroll, it is generally not what AVStream.start_time should contain

Originally committed as revision 9963 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2007-08-06 20:36:55 +00:00
parent 00a254b7fe
commit 371bf80642
2 changed files with 5 additions and 4 deletions

View File

@ -196,7 +196,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int type, type_specific_size, sizeX; int type, type_specific_size, sizeX;
uint64_t total_size; uint64_t total_size;
unsigned int tag1; unsigned int tag1;
int64_t pos1, pos2; int64_t pos1, pos2, start_time;
int test_for_ext_stream_audio, is_dvr_ms_audio=0; int test_for_ext_stream_audio, is_dvr_ms_audio=0;
pos1 = url_ftell(pb); pos1 = url_ftell(pb);
@ -209,10 +209,11 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!asf_st) if (!asf_st)
goto fail; goto fail;
st->priv_data = asf_st; st->priv_data = asf_st;
st->start_time = asf->hdr.preroll; start_time = asf->hdr.preroll;
if(!(asf->hdr.flags & 0x01)) { // if we aren't streaming... if(!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
st->duration = asf->hdr.send_time / st->duration = asf->hdr.send_time /
(10000000 / 1000) - st->start_time; (10000000 / 1000) - start_time;
} }
get_guid(pb, &g); get_guid(pb, &g);

View File

@ -4,7 +4,7 @@ ffmpeg regression test
./tests/data/b-libav.avi CRC=0x400c29e9 ./tests/data/b-libav.avi CRC=0x400c29e9
786446e80ead936e5faa8f5908f19281 *./tests/data/b-libav.asf 786446e80ead936e5faa8f5908f19281 *./tests/data/b-libav.asf
339775 ./tests/data/b-libav.asf 339775 ./tests/data/b-libav.asf
./tests/data/b-libav.asf CRC=0x74113749 ./tests/data/b-libav.asf CRC=0x7f38e57b
1ce78eeb6881ffe5b649a9b5105de919 *./tests/data/b-libav.rm 1ce78eeb6881ffe5b649a9b5105de919 *./tests/data/b-libav.rm
355405 ./tests/data/b-libav.rm 355405 ./tests/data/b-libav.rm
bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg