Commit 4676eede authored by michael's avatar michael

100l (avi seeking)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3155 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 33de739e
...@@ -597,8 +597,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp ...@@ -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, ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment