28 #define MAX_LINESIZE 2000
39 const char *header=
"[Script Info]";
41 if( !memcmp(p->
buf , header, strlen(header))
42 || !memcmp(p->
buf+3, header, strlen(header)))
60 int hour,
min, sec, hsec;
62 if(sscanf(p,
"%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4)
65 av_dlog(
NULL,
"%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
73 static int event_cmp(
const void *_a,
const void *_b)
75 const uint8_t *
const *
a = _a, *
const *
b = _b;
81 int i,
len, header_remaining;
96 header_remaining= INT_MAX;
104 if(!memcmp(line,
"[Events]", 8))
106 else if(line[0]==
'[')
107 header_remaining= INT_MAX;
109 i= header_remaining==0;
118 memcpy(p + pos[i], line, len+1);
121 else header_remaining--;
132 while(*p && *p !=
'\n')
157 end= strchr(p,
'\n');
170 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
182 int64_t min_ts_diff = INT64_MAX;
183 if (stream_index == -1) {
190 time_base.
num * (int64_t)AV_TIME_BASE,
196 int64_t ts_diff =
FFABS(pts - ts);
197 if (pts >= min_ts && pts <= max_ts && ts_diff < min_ts_diff) {
198 min_ts_diff = ts_diff;
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
int64_t pos
byte position in stream, -1 if unknown
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream ** streams
A list of all streams in the file.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
int flags
A combination of AV_PKT_FLAG values.
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define AV_TIME_BASE
Internal time base represented as integer.
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
enum AVMediaType codec_type
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
rational number numerator/denominator
This structure contains the data a format has to probe a file.
int eof_reached
true if eof reached
void * priv_data
Format private data.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
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.