summaryrefslogtreecommitdiff
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-17 15:23:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-17 15:23:11 +0100
commit5049b6a1fe52f549bad6721f162b4ec2d9d0a357 (patch)
treed62ca24e8d518600e8c6fee9f5ac2471fcd9ba99 /libavformat/mp3enc.c
parent045d80076a67aade020417f4adcb026b6a3da823 (diff)
parentf9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd (diff)
Merge commit 'f9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd'
* commit 'f9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd': mp3enc: add an option for disabling the Xing frame. Conflicts: doc/muxers.texi libavformat/mp3enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index a5f672b257..b4258e2aae 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -85,6 +85,7 @@ typedef struct MP3Context {
ID3v2EncContext id3;
int id3v2_version;
int write_id3v1;
+ int write_xing;
/* xing header */
int64_t xing_offset;
@@ -125,7 +126,7 @@ static int mp3_write_xing(AVFormatContext *s)
int needed;
const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
- if (!s->pb->seekable)
+ if (!s->pb->seekable || !mp3->write_xing)
return 0;
for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpa_freq_tab); i++) {
@@ -396,6 +397,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 },
};