51 if (p->
buf[0] ==
'.' && p->
buf[1] ==
's' &&
52 p->
buf[2] ==
'n' && p->
buf[3] ==
'd')
58 #define BLOCK_SIZE 1024
65 unsigned int id, channels, rate;
71 if (tag !=
MKTAG(
'.',
's',
'n',
'd'))
98 if (channels == 0 || channels >= INT_MAX / (
BLOCK_SIZE * bps >> 3)) {
103 if (rate == 0 || rate > INT_MAX) {
143 .read_probe = au_probe,
144 .read_header = au_read_header,
145 .read_packet = au_read_packet,
157 #define AU_UNKNOWN_SIZE ((uint32_t)(~0))
182 if ((ret = put_au_header(pb, s->
streams[0]->
codec)) < 0)
199 avio_wb32(pb, (uint32_t)(file_size - 24));
210 .mime_type =
"audio/basic",
214 .write_header = au_write_header,
216 .write_trailer = au_write_trailer,
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned int avio_rb32(AVIOContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
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,...)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
int void avio_flush(AVIOContext *s)
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static const AVCodecTag codec_au_tags[]
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This structure contains the data a format has to probe a file.
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.
void avio_wb32(AVIOContext *s, unsigned int val)
#define MKTAG(a, b, c, d)
This structure stores compressed data.