35 #define OPUS_SEEK_PREROLL_MS 80 36 #define OPUS_HEAD_SIZE 19 80 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
92 unsigned nb_frames = 1;
93 unsigned toc = src[0];
94 unsigned toc_config = toc >> 3;
95 unsigned toc_count = toc & 3;
96 unsigned frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
97 toc_config < 16 ? 480 << (toc_config & 1) :
98 120 << (toc_config & 3);
102 nb_frames = src[1] & 0x3F;
103 }
else if (toc_count) {
107 return frame_size * nb_frames;
121 if (os->
granule > (1LL << 62)) {
140 last_pkt = next_pkt = next_pkt + os->
psize;
141 for (; seg < os->
nsegs; seg++) {
143 if (os->
segments[seg] < 255 && next_pkt != last_pkt) {
172 "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).
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.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
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
Codec parameters associated with this stream.
#define AV_NOPTS_VALUE
Undefined timestamp value.