30#define MAX_STREAMS 4096
55 if (memcmp(p->buf,
"LIMITLESS", 9))
57 if (memcmp(p->buf + 9,
"HEAD", 4))
66 unsigned st_count,
mode;
87 for (
int i = 0;
i < st_count;
i++) {
145 if ((
int64_t)bpp * st_count * (
int64_t)sample_rate >= INT32_MAX ||
149 s->data =
av_calloc(st_count * sample_rate, bpp);
153 for (
unsigned i = 0;
i < st_count;
i++) {
171 s->header_len = (
ctx->nb_streams + 7) / 8;
181 const int bpp =
s->bpp;
192 if (
s->index >=
ctx->nb_streams) {
193 int cur_st = 0, st_count = 0, st_index = 0;
198 for (
int i = 0;
i <
s->header_len;
i++) {
199 uint8_t
val =
s->header[
i];
201 for (
int j = 0; j < 8 && cur_st <
ctx->nb_streams; j++, cur_st++) {
202 s->p[st_index].stored =
val & 1;
209 s->index =
s->stored_index = 0;
210 s->nb_stored = st_count;
218 st =
ctx->streams[
s->index];
219 stp = &
s->p[
s->index];
222 if (
s->index >=
ctx->nb_streams)
224 stp = &
s->p[
s->index];
226 st =
ctx->streams[
s->index];
235 pkt->data[n] =
s->data[n *
s->nb_stored +
s->stored_index];
251 pkt->stream_index =
s->index;
273 s->stored_index =
s->index =
s->nb_stored = 0;
281 .p.extensions =
"laf",
static double val(void *priv, double ch)
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.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
uint64_t avio_rl64(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_CH_FRONT_RIGHT
#define AV_CH_FRONT_CENTER
#define AV_CH_LOW_FREQUENCY
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MASK(nb, m)
Macro to define native channel layouts.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
static int laf_read_header(AVFormatContext *ctx)
static int laf_read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static int laf_read_packet(AVFormatContext *ctx, AVPacket *pkt)
static int laf_read_close(AVFormatContext *ctx)
static int laf_probe(const AVProbeData *p)
#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)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#define MKBETAG(a, b, c, d)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
AVChannelLayout ch_layout
The channel layout and number of channels.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
uint8_t header[(MAX_STREAMS+7)/8]
StreamParams p[MAX_STREAMS]
static AVFormatContext * ctx
static const uint8_t quality[]