50 unsigned header_size, comment_size;
81 if (sample_rate <= 0 || sample_rate > INT_MAX) {
86 sample_rate_frac = sample_rate - floor(sample_rate);
89 "truncating fractional part of sample rate (%f)\n",
92 if ((header_size + 4) & 7 || header_size <
SOX_FIXED_HDR + comment_size
98 if (comment_size && comment_size < UINT_MAX) {
99 char *comment =
av_malloc(comment_size+1);
102 if (
avio_read(pb, comment, comment_size) != comment_size) {
106 comment[comment_size] = 0;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
static int sox_probe(AVProbeData *p)
static int sox_read_header(AVFormatContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
unsigned int avio_rb32(AVIOContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
uint64_t avio_rb64(AVIOContext *s)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int block_align
Audio only.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
AVIOContext * pb
I/O context.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
This structure contains the data a format has to probe a file.
int sample_rate
Audio only.
AVInputFormat ff_sox_demuxer
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define SOX_FIXED_HDR
Size of fixed header without magic.
uint64_t avio_rl64(AVIOContext *s)