aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-01-14 21:47:45 +0100
committerAnton Khirnov <anton@khirnov.net>2014-01-17 10:30:45 +0100
commitf9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd (patch)
treedc5879f393d9b26e9cabd041c15ea5b04731d4b7 /libavformat
parent045654f422e74be8ed09a0819d39051d67633a09 (diff)
downloadffmpeg-f9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd.tar.gz
mp3enc: add an option for disabling the Xing frame.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mp3enc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index 574a3b2e95..ea9db720ad 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -84,6 +84,7 @@ typedef struct MP3Context {
ID3v2EncContext id3;
int id3v2_version;
int write_id3v1;
+ int write_xing;
/* xing header */
int64_t xing_offset;
@@ -121,7 +122,7 @@ static void mp3_write_xing(AVFormatContext *s)
int xing_offset;
int ver = 0;
- if (!s->pb->seekable)
+ if (!s->pb->seekable || !mp3->write_xing)
return;
for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpa_freq_tab); i++) {
@@ -321,6 +322,8 @@ static const AVOption options[] = {
offsetof(MP3Context, id3v2_version), AV_OPT_TYPE_INT, {.i64 = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
{ "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
offsetof(MP3Context, write_id3v1), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
+ { "write_xing", "Write the Xing header containing file duration.",
+ offsetof(MP3Context, write_xing), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};