From f8fab7499666e4d157919b7190d916db9f94a665 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 7 Mar 2011 10:24:37 +0100 Subject: [PATCH] Seek back to old position after reading id3v1 tag. FFmpeg did not seek back to the original position, but to "0", making reading a VBR tag impossible. (issue 2645) --- libavformat/id3v1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c index e17e785ad..9bd10ca9c 100644 --- a/libavformat/id3v1.c +++ b/libavformat/id3v1.c @@ -227,6 +227,7 @@ void ff_id3v1_read(AVFormatContext *s) { int ret, filesize; uint8_t buf[ID3v1_TAG_SIZE]; + int64_t position = url_ftell(s->pb); if (!url_is_streamed(s->pb)) { /* XXX: change that */ @@ -237,7 +238,7 @@ void ff_id3v1_read(AVFormatContext *s) if (ret == ID3v1_TAG_SIZE) { parse_tag(s, buf); } - avio_seek(s->pb, 0, SEEK_SET); + avio_seek(s->pb, position, SEEK_SET); } } } -- 2.11.0