comparison libmpdemux/demux_mkv.c @ 23572:a00685941686

demux_mkv very long seek fix The seek code searching for the closest position in the index used "int64_t min_diff=0xFFFFFFFL" as the initial "further from the goal than any real alternative" value. The unit is milliseconds so seeks more than about 75 hours past the end of the file would fail to recognize the last index position as the best match. This was triggered in practice by chapter seek code which apparently uses a seek of 1000000000 seconds forward to mean "seek to the end". The practical effect was that trying to seek to the next chapter in a file without chapters made MPlayer block until it finished reading the file from the current position to the end. Fixed by increasing the initial value from FFFFFFF to FFFFFFFFFFFFFFF.
author uau
date Wed, 20 Jun 2007 18:19:03 +0000
parents eb85913b9dc3
children d0ed8af54675
comparison
equal deleted inserted replaced
23571:f3dd45afeaf7 23572:a00685941686
3392 free_cached_dps (demuxer); 3392 free_cached_dps (demuxer);
3393 if (!(flags & 2)) /* time in secs */ 3393 if (!(flags & 2)) /* time in secs */
3394 { 3394 {
3395 mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; 3395 mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv;
3396 stream_t *s = demuxer->stream; 3396 stream_t *s = demuxer->stream;
3397 int64_t target_timecode = 0, diff, min_diff=0xFFFFFFFL; 3397 int64_t target_timecode = 0, diff, min_diff=0xFFFFFFFFFFFFFFFLL;
3398 int i; 3398 int i;
3399 3399
3400 if (!(flags & 1)) /* relative seek */ 3400 if (!(flags & 1)) /* relative seek */
3401 target_timecode = (int64_t) (mkv_d->last_pts * 1000.0); 3401 target_timecode = (int64_t) (mkv_d->last_pts * 1000.0);
3402 target_timecode += (int64_t)(rel_seek_secs * 1000.0); 3402 target_timecode += (int64_t)(rel_seek_secs * 1000.0);