44 "LRC supports only a single subtitle stream.\n");
66 for(metadata_item =
NULL;
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);
97 data[pkt->
size] =
'\0';
99 for(delim = data + pkt->
size - 1;
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");
125 ((pkt->
pts / 100) % 60),
132 ((-pkt->
pts) / 100) % 60,
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
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. ...
enum AVMediaType codec_type
General type of the encoded data.
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.
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.
AVCodecParameters * codecpar
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