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;
120 if (os->
granule > (1LL << 62)) {
139 last_pkt = next_pkt = next_pkt + os->
psize;
140 for (; seg < os->
nsegs; seg++) {
142 if (os->
segments[seg] < 255 && next_pkt != last_pkt) {
171 "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)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
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)
AVStream ** streams
A list of all streams in the file.
int initial_padding
Audio only.
int end_trimming
set the number of packets to drop from the end
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.
enum AVMediaType codec_type
General type of the encoded data.
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
const struct ogg_codec ff_opus_codec
int seek_preroll
Audio only.
int sample_rate
Audio only.
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 * priv_data
Format private data.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVCodecParameters * codecpar
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.