35 #define OPUS_SEEK_PREROLL_MS 80
36 #define OPUS_HEAD_SIZE 19
79 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
91 unsigned nb_frames = 1;
92 unsigned toc = src[0];
93 unsigned toc_config = toc >> 3;
94 unsigned toc_count = toc & 3;
95 unsigned frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
96 toc_config < 16 ? 480 << (toc_config & 1) :
97 120 << (toc_config & 3);
101 nb_frames = src[1] & 0x3F;
102 }
else if (toc_count) {
106 return frame_size * nb_frames;
135 last_pkt = next_pkt = next_pkt + os->
psize;
136 for (; seg < os->
nsegs; seg++) {
138 if (os->
segments[seg] < 255 && next_pkt != last_pkt) {
167 "Last packet was truncated to %d due to end trimming.\n",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
#define OPUS_SEEK_PREROLL_MS
static int opus_duration(uint8_t *src, int size)
static int opus_header(AVFormatContext *avf, int idx)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
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.
int end_trimming
set the number of packets to drop from the end
int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st, const uint8_t *buf, int size)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVCodecContext * codec
Codec context associated with this stream.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
struct ogg_stream * streams
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 presentation order, in stream time base...
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
void av_codec_set_seek_preroll(AVCodecContext *avctx, int val)
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.