Browse code

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)

Carl Eugen Hoyos authored on 2011/03/07 18:24:37
Showing 1 changed files
... ...
@@ -227,6 +227,7 @@ void ff_id3v1_read(AVFormatContext *s)
227 227
 {
228 228
     int ret, filesize;
229 229
     uint8_t buf[ID3v1_TAG_SIZE];
230
+    int64_t position = url_ftell(s->pb);
230 231
 
231 232
     if (!url_is_streamed(s->pb)) {
232 233
         /* XXX: change that */
... ...
@@ -237,7 +238,7 @@ void ff_id3v1_read(AVFormatContext *s)
237 237
             if (ret == ID3v1_TAG_SIZE) {
238 238
                 parse_tag(s, buf);
239 239
             }
240
-            avio_seek(s->pb, 0, SEEK_SET);
240
+            avio_seek(s->pb, position, SEEK_SET);
241 241
         }
242 242
     }
243 243
 }