Lines Matching refs:os
41 struct ogg_stream *os = &ogg->streams[idx];
43 struct oggopus_private *priv = os->private;
44 uint8_t *packet = os->buf + os->pstart;
48 priv = os->private = av_mallocz(sizeof(*priv));
53 if (os->flags & OGG_FLAG_BOS) {
54 if (os->psize < OPUS_HEAD_SIZE || (AV_RL8(packet + 8) & 0xF0) != 0)
62 os->start_trimming = priv->pre_skip;
67 if ((ret = ff_alloc_extradata(st->codecpar, os->psize)) < 0)
70 memcpy(st->codecpar->extradata, packet, os->psize);
81 if (os->psize < 8 || memcmp(packet, "OpusTags", 8))
83 ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8);
114 struct ogg_stream *os = &ogg->streams[idx];
116 struct oggopus_private *priv = os->private;
117 uint8_t *packet = os->buf + os->pstart;
120 if (!os->psize)
122 if (os->granule > (1LL << 62)) {
123 av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
127 if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
130 uint8_t *last_pkt = os->buf + os->pstart;
134 seg = os->segp;
135 d = opus_duration(last_pkt, os->psize);
137 os->pflags |= AV_PKT_FLAG_CORRUPT;
141 last_pkt = next_pkt = next_pkt + os->psize;
142 for (; seg < os->nsegs; seg++) {
143 next_pkt += os->segments[seg];
144 if (os->segments[seg] < 255 && next_pkt != last_pkt) {
151 os->lastpts =
152 os->lastdts = os->granule - duration;
155 if ((ret = opus_duration(packet, os->psize)) < 0)
158 os->pduration = ret;
159 if (os->lastpts != AV_NOPTS_VALUE) {
161 st->start_time = os->lastpts;
162 priv->cur_dts = os->lastdts = os->lastpts -= priv->pre_skip;
165 priv->cur_dts += os->pduration;
166 if ((os->flags & OGG_FLAG_EOS)) {
167 int64_t skip = priv->cur_dts - os->granule + priv->pre_skip;
168 skip = FFMIN(skip, os->pduration);
170 os->pduration = skip < os->pduration ? os->pduration - skip : 1;
171 os->end_trimming = skip;
174 os->pduration);