X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmp3enc.c;h=f4814be80e17c85251186407baf46d92aaa4a0bb;hb=4a660fac9899191d4121cde02f2a98977b1303b6;hp=dd662f5473c8bd0b9f9f0c9d7acd2c8f1be41598;hpb=67d466d09b105b2b1d3d8da4c21d8975925741ae;p=ffmpeg diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index dd662f5473c..f4814be80e1 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -391,6 +391,7 @@ static void mp3_update_xing(AVFormatContext *s) uint16_t tag_crc; uint8_t *toc; int i, rg_size; + int64_t old_pos = avio_tell(s->pb); /* replace "Xing" identification string with "Info" for CBR files. */ if (!mp3->has_variable_bitrate) @@ -450,7 +451,7 @@ static void mp3_update_xing(AVFormatContext *s) avio_seek(s->pb, mp3->xing_frame_offset, SEEK_SET); avio_write(s->pb, mp3->xing_frame, mp3->xing_frame_size); - avio_seek(s->pb, 0, SEEK_END); + avio_seek(s->pb, old_pos, SEEK_SET); } static int mp3_write_trailer(struct AVFormatContext *s)