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.
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.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
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_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
uint64_t avio_rb64(AVIOContext *s)
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.
#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. ...
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 bit_rate
the average bitrate
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
enum AVMediaType codec_type
int sample_rate
samples per second
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.
AVInputFormat ff_sox_demuxer
int channels
number of audio channels
#define SOX_FIXED_HDR
Size of fixed header without magic.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
uint64_t avio_rl64(AVIOContext *s)