29 #include "libavutil/bprint.h"
34 if (!strncmp(p,
"[br]", 4)) {
38 if (p[0] ==
'\n' && p[1])
40 else if (*p !=
'\n' && *p !=
'\r')
55 const char *ptr = avpkt->
data;
59 if (ptr && sscanf(ptr,
"%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) {
61 "information). You need to upgrade your libavformat or "
62 "sanitize your packet.\n");
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
static int subviewer_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
const char * name
Name of the codec implementation.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_BPRINT_SIZE_UNLIMITED
Convenience macros for special values for av_bprint_init() size_max parameter.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Libavcodec external API header.
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int ts_start, int duration, int raw)
Add an ASS dialog line to an AVSubtitle as a new AVSubtitleRect.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Init a print buffer.
static int subviewer_event_to_ass(AVBPrint *buf, const char *p)
Buffer to print data progressively.
main external API structure.
AVCodec ff_subviewer_decoder
void av_bprintf(AVBPrint *buf, const char *fmt,...) av_printf_format(2
Append a formatted string to a print buffer.
#define AVERROR_INVALIDDATA
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...