36 const unsigned char *ptr = p->
buf;
38 if (strstr(ptr,
"******** START SCRIPT ********"))
64 if (!strncmp(
line,
"[DELAY]", 7)) {
66 sscanf(
line,
"%d", &delay);
69 if (sscanf(
line,
"[%d:%d:%d]", &hh, &mm, &
ss) == 3) {
71 int64_t pts_start = hh*3600LL + mm*60LL +
ss + delay;
77 sub->duration = pts_start -
sub->pts;
106 min_ts, ts, max_ts,
flags);
117 .
name =
"subviewer1",
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
#define flags(name, subs,...)
#define ss(width, name, subs,...)
static float sub(float src0, float src1)
static int read_header(FFV1Context *f)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int ff_subtitles_queue_seek(FFDemuxSubtitlesQueue *q, AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Update current_sub_idx to emulate a seek.
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
Generic read_packet() callback for subtitles demuxers using this queue system.
void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
Set missing durations, sort subtitles by PTS (and then byte position), and drop duplicated events.
void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q)
Remove and destroy all the subtitles packets.
AVPacket * ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, const uint8_t *event, size_t len, int merge)
Insert a new subtitle event.
static int subviewer1_probe(const AVProbeData *p)
static int subviewer1_read_close(AVFormatContext *s)
static int subviewer1_read_packet(AVFormatContext *s, AVPacket *pkt)
static int subviewer1_read_header(AVFormatContext *s)
static int subviewer1_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
AVInputFormat ff_subviewer1_demuxer