Commit 13eadbac authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos Committed by Ronald S. Bultje

id3v1: Seek back to old position after reading.

FFmpeg did not seek back to the original position, but to "0", making
reading a VBR tag impossible.
(issue 2645)
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent c4549bd6
...@@ -227,6 +227,7 @@ void ff_id3v1_read(AVFormatContext *s) ...@@ -227,6 +227,7 @@ void ff_id3v1_read(AVFormatContext *s)
{ {
int ret, filesize; int ret, filesize;
uint8_t buf[ID3v1_TAG_SIZE]; uint8_t buf[ID3v1_TAG_SIZE];
int64_t position = avio_tell(s->pb);
if (!url_is_streamed(s->pb)) { if (!url_is_streamed(s->pb)) {
/* XXX: change that */ /* XXX: change that */
...@@ -237,7 +238,7 @@ void ff_id3v1_read(AVFormatContext *s) ...@@ -237,7 +238,7 @@ void ff_id3v1_read(AVFormatContext *s)
if (ret == ID3v1_TAG_SIZE) { if (ret == ID3v1_TAG_SIZE) {
parse_tag(s, buf); parse_tag(s, buf);
} }
avio_seek(s->pb, 0, SEEK_SET); avio_seek(s->pb, position, SEEK_SET);
} }
} }
} }
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