aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-05-14 12:12:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:11:55 +0200
commit276e97f05554dc8c36c573ce48de0ea9131b93f6 (patch)
treea145e12ab8819c6a6a2388fc88ffe2c45bb44ce6
parentdeaa56a0555078a9557e29502d4c1cb36736e6cc (diff)
downloadffmpeg-276e97f05554dc8c36c573ce48de0ea9131b93f6.tar.gz
avformat/mp3enc: Avoid SEEK_END as it is unsupported
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit bf3ee6a13053d37a0c5022a324624e89f0bce8c5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mp3enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 4c97fa113b..3a7c1a1ceb 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -393,6 +393,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)
@@ -452,7 +453,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)