int eof; /**< end-of-file flag */
int dsp_initialized; /**< vd has been initialized */
vorbis_comment vc; /**< VorbisComment info */
- ogg_packet op; /**< ogg packet */
double iblock; /**< impulse block bias option */
- VorbisParseContext vp; /**< parse context to get durations */
+ AVVorbisParseContext vp; /**< parse context to get durations */
AudioFrameQueue afq; /**< frame queue for timestamps */
-} LibvorbisContext;
+} LibvorbisEncContext;
static const AVOption options[] = {
- { "iblock", "Sets the impulse block bias", offsetof(LibvorbisContext, iblock), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
+ { "iblock", "Sets the impulse block bias", offsetof(LibvorbisEncContext, iblock), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
return 0;
}
- int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,
-int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
- int buf_size)
++int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
+ int buf_size, int *flags)
{
int duration = 0;
return duration;
}
- int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
++int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
+ int buf_size)
+{
+ return avpriv_vorbis_parse_frame_flags(s, buf, buf_size, NULL);
+}
+
- void avpriv_vorbis_parse_reset(VorbisParseContext *s)
+ void avpriv_vorbis_parse_reset(AVVorbisParseContext *s)
{
if (s->valid_extradata)
- s->previous_blocksize = s->mode_blocksize[0];
+ s->previous_blocksize = s->blocksize[0];
}
#if CONFIG_VORBIS_PARSER
* @param avctx codec context
* @param s Vorbis parser context
*/
- int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
+ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s);
- int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,
+#define VORBIS_FLAG_HEADER 0x00000001
+#define VORBIS_FLAG_COMMENT 0x00000002
+
+/**
+ * Get the duration for a Vorbis packet.
+ *
+ * avpriv_vorbis_parse_extradata() must have been successfully called prior to
+ * this in order for a correct duration to be returned. If @p flags is @c NULL,
+ * special frames are considered invalid.
+ *
+ * @param s Vorbis parser context
+ * @param buf buffer containing a Vorbis frame
+ * @param buf_size size of the buffer
+ * @param flags flags for special frames
+ */
++int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
+ int buf_size, int *flags);
+
/**
* Get the duration for a Vorbis packet.
*