diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-24 15:47:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-24 16:15:25 +0200 |
commit | 2dbee1a3935a91842c22eb65fd13f77e8d590e07 (patch) | |
tree | 653bba36ef750d2ac5d6a142b0fe36905b773ec4 /libavformat | |
parent | e744e9a305896d8cbe3c06951b0a7e535ccd8562 (diff) | |
download | ffmpeg-2dbee1a3935a91842c22eb65fd13f77e8d590e07.tar.gz |
avformat/mp3enc: Squeeze our mp3 encoder tag into the 9byte shortname instead of randomly truncating
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mp3enc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 713dcd143c..a691f75f99 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -231,7 +231,12 @@ static int mp3_write_xing(AVFormatContext *s) // encoder short version string if (enc) { uint8_t encoder_str[9] = { 0 }; - memcpy(encoder_str, enc->value, FFMIN(strlen(enc->value), sizeof(encoder_str))); + if ( strlen(enc->value) > sizeof(encoder_str) + && !strcmp("Lavc libmp3lame", enc->value)) { + memcpy(encoder_str, "Lavf lame", 9); + } else + memcpy(encoder_str, enc->value, FFMIN(strlen(enc->value), sizeof(encoder_str))); + avio_write(dyn_ctx, encoder_str, sizeof(encoder_str)); } else avio_write(dyn_ctx, "Lavf\0\0\0\0\0", 9); |