aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-05-14 12:12:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:45 +0100
commitf5f6fb9a99eb6f12e1147f37867704bd595818e9 (patch)
tree43ee1b38eaaa3003e5786a582c9eb88e8b0108c7
parent9fcf6e9dfce55fd2433d306ff3ce81093654872b (diff)
downloadffmpeg-f5f6fb9a99eb6f12e1147f37867704bd595818e9.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 dd662f5473..f4814be80e 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)