35 #define OPUS_HEAD_SIZE 19 64 memcpy(extradata, packet, os->
psize);
75 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
92 unsigned toc, toc_config, toc_count,
frame_size, nb_frames = 1;
98 toc_config = toc >> 3;
100 frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
101 toc_config < 16 ? 480 << (toc_config & 1) :
102 120 << (toc_config & 3);
103 if (toc_count == 3) {
106 nb_frames = packet[1] & 0x3F;
107 }
else if (toc_count) {
125 "Last packet is truncated to %d (because of unimplemented end trim support).\n",
140 .granule_is_start = 1,
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
#define AV_LOG_WARNING
Something somehow does not look correct.
static int opus_header(AVFormatContext *avf, int idx)
static int opus_packet(AVFormatContext *avf, int idx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream ** streams
A list of all streams in the file.
static const uint8_t frame_size[4]
int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st, const uint8_t *buf, int size)
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
Codec context associated with this stream.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
struct ogg_stream * streams
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
enum AVMediaType codec_type
int sample_rate
samples per second
const struct ogg_codec ff_opus_codec
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 * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AV_NOPTS_VALUE
Undefined timestamp value.