100l (avi seeking)

Originally committed as revision 3155 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2004-05-24 15:13:23 +00:00
parent cde073b448
commit 4fc2c6447f
2 changed files with 2 additions and 3 deletions

View File

@ -597,8 +597,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
return -1;
ast = st->priv_data;
/* compute the frame number */
frame_number = (timestamp * ast->rate) /
(ast->scale * (int64_t)AV_TIME_BASE);
frame_number = timestamp;
#ifdef DEBUG_SEEK
printf("timestamp=%0.3f nb_indexes=%d frame_number=%d\n",
(double)timestamp / AV_TIME_BASE,

View File

@ -558,7 +558,7 @@ static void compute_frame_duration(int *pnum, int *pden,
}
static int64_t lsb2full(int64_t lsb, int64_t last_ts, int lsb_bits){
int64_t mask = (1LL<<lsb_bits)-1;
int64_t mask = lsb_bits < 64 ? (1LL<<lsb_bits)-1 : -1LL;
int64_t delta= last_ts - mask/2;
return ((lsb - delta)&mask) + delta;
}