forked from FFmpeg/FFmpeg
100l (avi seeking)
Originally committed as revision 3155 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cde073b448
commit
4fc2c6447f
2 changed files with 2 additions and 3 deletions
|
@ -597,8 +597,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
|
||||||
return -1;
|
return -1;
|
||||||
ast = st->priv_data;
|
ast = st->priv_data;
|
||||||
/* compute the frame number */
|
/* compute the frame number */
|
||||||
frame_number = (timestamp * ast->rate) /
|
frame_number = timestamp;
|
||||||
(ast->scale * (int64_t)AV_TIME_BASE);
|
|
||||||
#ifdef DEBUG_SEEK
|
#ifdef DEBUG_SEEK
|
||||||
printf("timestamp=%0.3f nb_indexes=%d frame_number=%d\n",
|
printf("timestamp=%0.3f nb_indexes=%d frame_number=%d\n",
|
||||||
(double)timestamp / AV_TIME_BASE,
|
(double)timestamp / AV_TIME_BASE,
|
||||||
|
|
|
@ -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){
|
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;
|
int64_t delta= last_ts - mask/2;
|
||||||
return ((lsb - delta)&mask) + delta;
|
return ((lsb - delta)&mask) + delta;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue