#include "id3v1.h"
#include "id3v2.h"
#include "rawenc.h"
+#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
{
AVMetadataTag *tag;
if ((tag = av_metadata_get(s->metadata, key, NULL, 0)))
- strncpy(buf, tag->value, buf_size);
+ av_strlcpy(buf, tag->value, buf_size);
return !!tag;
}
uint8_t *pb;
int (*put)(AVIOContext*, const char*);
AVIOContext *dyn_buf;
- if (url_open_dyn_buf(&dyn_buf) < 0)
+ if (avio_open_dyn_buf(&dyn_buf) < 0)
return AVERROR(ENOMEM);
/* check if the strings are ASCII-only and use UTF16 only if
put(dyn_buf, str1);
if (str2)
put(dyn_buf, str2);
- len = url_close_dyn_buf(dyn_buf, &pb);
+ len = avio_close_dyn_buf(dyn_buf, &pb);
avio_wb32(s->pb, tag);
id3v2_put_size(s, len);
static const AVOption options[] = {
{ "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
- offsetof(MP3Context, id3v2_version), FF_OPT_TYPE_INT, 4, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
+ offsetof(MP3Context, id3v2_version), FF_OPT_TYPE_INT, {.dbl = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
static const AVClass mp3_muxer_class = {
- "MP3 muxer",
- av_default_item_name,
- options,
- LIBAVUTIL_VERSION_INT,
+ .class_name = "MP3 muxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
};
static int id3v2_check_write_tag(AVFormatContext *s, AVMetadataTag *t, const char table[][4],