Commit a606ef07 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: use integer seek times

parent a234de1e
...@@ -212,9 +212,9 @@ time_from_ffmpeg(int64_t t, const AVRational time_base) ...@@ -212,9 +212,9 @@ time_from_ffmpeg(int64_t t, const AVRational time_base)
gcc_const gcc_const
static int64_t static int64_t
time_to_ffmpeg(double t, const AVRational time_base) time_to_ffmpeg(double t_ms, const AVRational time_base)
{ {
return av_rescale_q((int64_t)(t * 1024), (AVRational){1, 1024}, return av_rescale_q(t_ms, (AVRational){1, 1000},
time_base); time_base);
} }
...@@ -547,7 +547,7 @@ ffmpeg_decode(Decoder &decoder, InputStream &input) ...@@ -547,7 +547,7 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
if (cmd == DecoderCommand::SEEK) { if (cmd == DecoderCommand::SEEK) {
int64_t where = int64_t where =
time_to_ffmpeg(decoder_seek_where(decoder), time_to_ffmpeg(decoder_seek_where_ms(decoder),
av_stream->time_base) + av_stream->time_base) +
start_time_fallback(*av_stream); start_time_fallback(*av_stream);
......
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