Commit 171dd675 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mp3dec: optimize mp3_seek() for dir < 0

this minimizes the amount of protocol seeks and reading needed in that case
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9600486d
......@@ -318,6 +318,8 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
return -1;
}
if (dir < 0)
avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET);
ret = avio_seek(s->pb, ie->pos, SEEK_SET);
if (ret < 0)
return ret;
......
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