57 unsigned header_size, comment_size;
58 double sample_rate, sample_rate_frac;
91 if (sample_rate <= 0 || sample_rate > INT_MAX ||
isnan(sample_rate)) {
96 sample_rate_frac = sample_rate -
floor(sample_rate);
99 "truncating fractional part of sample rate (%f)\n",
102 if ((header_size + 4) & 7 || header_size <
SOX_FIXED_HDR + comment_size
108 if (comment_size && comment_size < UINT_MAX) {
uint64_t avio_rb64(AVIOContext *s)
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)
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 FUNC comment(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawComment *current)
static __device__ float floor(float a)
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
#define SOX_FIXED_HDR
Size of fixed header without magic.
static int sox_read_header(AVFormatContext *s)
static int sox_probe(const AVProbeData *p)
int nb_channels
Number of channels in this layout.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
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 contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.