aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-05-24 15:13:23 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-05-24 15:13:23 +0000
commit4fc2c6447ff5432da131082662e0345f8772721c (patch)
treea7a1e06ef29842b849d83341e189af34c52e0df6
parentcde073b44865e9d5e3863e865af921a3bf1dac1f (diff)
downloadffmpeg-4fc2c6447ff5432da131082662e0345f8772721c.tar.gz
100l (avi seeking)
Originally committed as revision 3155 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/avidec.c3
-rw-r--r--libavformat/utils.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index fbc81f0135..31b5b5f2e4 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -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,
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 88a88673ef..b60367c090 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;
}