44 "LRC supports only a single subtitle stream.\n");
65 for(metadata_item =
NULL;
69 if(!metadata_item->
value[0]) {
72 while((delim = strchr(metadata_item->
value,
'\n'))) {
75 while((delim = strchr(metadata_item->
value,
'\r'))) {
79 metadata_item->
key, metadata_item->
value);
96 data[pkt->
size] =
'\0';
98 for(delim = data + pkt->
size - 1;
99 delim >= data && (delim[0] ==
'\n' || delim[0] ==
'\r'); delim--) {
103 while(line[0] ==
'\n' || line[0] ==
'\r') {
108 delim = strchr(line,
'\n');
110 if(delim > line && delim[-1] ==
'\r') {
118 "Subtitle starts with '[', may cause problems with LRC format.\n");
124 ((pkt->
pts / 100) % 60),
131 ((-pkt->
pts) / 100) % 60,
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int flags
Flags modifying the (de)muxer behaviour.
Utility Preprocessor macros.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodecContext * codec
Codec context associated with this stream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
const AVMetadataConv ff_lrc_metadata_conv[]
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
enum AVMediaType codec_type
AVOutputFormat ff_lrc_muxer
AVIOContext * pb
I/O context.
static int lrc_write_packet(AVFormatContext *s, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static int lrc_write_header(AVFormatContext *s)
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2