41 if(
s->nb_streams != 1 ||
44 "LRC supports only a single subtitle stream.\n");
66 for(metadata_item =
NULL;
67 (metadata_item =
av_dict_get(
s->metadata,
"", metadata_item,
70 if(!metadata_item->
value[0]) {
73 while((delim = strchr(metadata_item->
value,
'\n'))) {
76 while((delim = strchr(metadata_item->
value,
'\r'))) {
80 metadata_item->
key, metadata_item->
value);
100 delim >=
data && (delim[0] ==
'\n' || delim[0] ==
'\r'); delim--) {
104 while(
line[0] ==
'\n' ||
line[0] ==
'\r') {
109 delim = strchr(
line,
'\n');
111 if(delim >
line && delim[-1] ==
'\r') {
119 "Subtitle starts with '[', may cause problems with LRC format.\n");
123 avio_printf(
s->pb,
"[%02"PRId64
":%02"PRId64
".%02"PRId64
"]",
130 avio_printf(
s->pb,
"[-%02"PRId64
":%02"PRId64
".%02"PRId64
"]",
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
Writes a formatted string to the context.
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
@ AV_CODEC_ID_TEXT
raw UTF-8 text
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_NOPTS_VALUE
Undefined timestamp value.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const AVMetadataConv ff_lrc_metadata_conv[]
AVOutputFormat ff_lrc_muxer
static int lrc_write_header(AVFormatContext *s)
static int lrc_write_packet(AVFormatContext *s, AVPacket *pkt)
Utility Preprocessor macros.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...