diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-10-29 16:35:26 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-11-06 09:00:46 +0100 |
commit | 2f3fadfbe3c6ad52fad5c614b6067c5401227959 (patch) | |
tree | bc87873036253702b95261fe23371d79c54d4b15 /libavcodec/libvorbis.c | |
parent | 5e80fb7ff226f136dbcf3fed00a2966bf8e9bd70 (diff) | |
download | ffmpeg-2f3fadfbe3c6ad52fad5c614b6067c5401227959.tar.gz |
lavc,lavf: switch to the new vorbis parse API
Diffstat (limited to 'libavcodec/libvorbis.c')
-rw-r--r-- | libavcodec/libvorbis.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c index 3b3eca8c10..f7ea253c4f 100644 --- a/libavcodec/libvorbis.c +++ b/libavcodec/libvorbis.c @@ -33,7 +33,7 @@ #include "bytestream.h" #include "internal.h" #include "vorbis.h" -#include "vorbis_parser_internal.h" +#include "vorbis_parser.h" #undef NDEBUG #include <assert.h> @@ -58,7 +58,7 @@ typedef struct LibvorbisContext { vorbis_comment vc; /**< VorbisComment info */ ogg_packet op; /**< ogg packet */ 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 */ } LibvorbisContext; @@ -163,6 +163,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; } @@ -221,7 +223,8 @@ static av_cold int libvorbis_encode_init(AVCodecContext *avctx) offset += header_code.bytes; assert(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; } @@ -318,7 +321,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 */ |