Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-02 03:18:25 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-03-23 23:31:05 +0400
commitb017785fa55cf42d61e84861eba7c73dd4d33e3b (patch)
treed08768fa53c4826ff7f42f1247725eaa966a426f /libavformat
parent01507eb1f87dcccfe6e0e66cd3ab0a4a973169f1 (diff)
avformat/mp3dec: optimize mp3_seek() for dir < 0
this minimizes the amount of protocol seeks and reading needed in that case Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 171dd67520b649a5b7a0f4fbff72ac88bbedfeab) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mp3dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index c1ce173737..ba77bce238 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -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;