summaryrefslogtreecommitdiff
path: root/libavcodec/libvorbisenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-06 12:05:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-06 12:05:17 +0100
commitf74be3669daa8b471fb8919fa980d9bed3207af2 (patch)
treebfdf6fa599e90dab47753d0b7974421d6766023f /libavcodec/libvorbisenc.c
parent7ffdc7bef2f9d7e90487f816a97a3496b0639450 (diff)
parent2f3fadfbe3c6ad52fad5c614b6067c5401227959 (diff)
Merge commit '2f3fadfbe3c6ad52fad5c614b6067c5401227959'
* commit '2f3fadfbe3c6ad52fad5c614b6067c5401227959': lavc,lavf: switch to the new vorbis parse API Conflicts: libavformat/oggparsevorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvorbisenc.c')
-rw-r--r--libavcodec/libvorbisenc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c
index 197f863c7b..4d16b755ec 100644
--- a/libavcodec/libvorbisenc.c
+++ b/libavcodec/libvorbisenc.c
@@ -27,7 +27,7 @@
#include "audio_frame_queue.h"
#include "internal.h"
#include "vorbis.h"
-#include "vorbis_parser_internal.h"
+#include "vorbis_parser.h"
/* Number of samples the user should send in each call.
@@ -49,7 +49,7 @@ typedef struct LibvorbisEncContext {
int dsp_initialized; /**< vd has been initialized */
vorbis_comment vc; /**< VorbisComment info */
double iblock; /**< impulse block bias option */
- AVVorbisParseContext vp; /**< parse context to get durations */
+ AVVorbisParseContext *vp; /**< parse context to get durations */
AudioFrameQueue afq; /**< frame queue for timestamps */
} LibvorbisEncContext;
@@ -187,6 +187,8 @@ static av_cold int libvorbis_encode_close(AVCodecContext *avctx)
ff_af_queue_close(&s->afq);
av_freep(&avctx->extradata);
+ av_vorbis_parse_free(&s->vp);
+
return 0;
}
@@ -246,7 +248,8 @@ static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
offset += header_code.bytes;
av_assert0(offset == avctx->extradata_size);
- if ((ret = avpriv_vorbis_parse_extradata(avctx, &s->vp)) < 0) {
+ s->vp = av_vorbis_parse_init(avctx->extradata, avctx->extradata_size);
+ if (!s->vp) {
av_log(avctx, AV_LOG_ERROR, "invalid extradata\n");
return ret;
}
@@ -341,7 +344,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avpkt->pts = ff_samples_to_time_base(avctx, op.granulepos);
- duration = avpriv_vorbis_parse_frame(&s->vp, avpkt->data, avpkt->size);
+ duration = av_vorbis_parse_frame(s->vp, avpkt->data, avpkt->size);
if (duration > 0) {
/* we do not know encoder delay until we get the first packet from
* libvorbis, so we have to update the AudioFrameQueue counts */