34 const uint8_t *d = p->
buf;
36 if (d[0] ==
'T' && d[1] ==
'T' && d[2] ==
'A' && d[3] ==
'1')
45 int i, channels,
bps, samplerate, datalen, framelen;
46 uint64_t framepos, start_offset;
59 if(samplerate <= 0 || samplerate > 1000000){
72 framelen = samplerate*256/245;
73 c->
totalframes = datalen / framelen + ((datalen % framelen) ? 1 : 0);
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
void ff_id3v1_read(AVFormatContext *s)
Read an ID3v1 tag.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int read_header(FFV1Context *f)
#define AVERROR_EOF
End of file.
bitstream reader API header.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
struct TTAContext TTAContext
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
AVCodecContext * codec
codec context
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(AVProbeData *p)
enum AVMediaType codec_type
int sample_rate
samples per second
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
unsigned int avio_rl16(AVIOContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
int channels
number of audio channels
void * priv_data
Format private data.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
#define AV_DICT_IGNORE_SUFFIX