aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
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 /libavformat
parent7ffdc7bef2f9d7e90487f816a97a3496b0639450 (diff)
parent2f3fadfbe3c6ad52fad5c614b6067c5401227959 (diff)
downloadffmpeg-f74be3669daa8b471fb8919fa980d9bed3207af2.tar.gz
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 'libavformat')
-rw-r--r--libavformat/oggparsevorbis.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 7efa660976..dd671301e1 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -30,7 +30,7 @@
#include "libavutil/dict.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/get_bits.h"
-#include "libavcodec/vorbis_parser_internal.h"
+#include "libavcodec/vorbis_parser.h"
#include "avformat.h"
#include "flac_picture.h"
#include "internal.h"
@@ -213,7 +213,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
struct oggvorbis_private {
unsigned int len[3];
unsigned char *packet[3];
- AVVorbisParseContext vp;
+ AVVorbisParseContext *vp;
int64_t final_pts;
int final_duration;
};
@@ -253,9 +253,11 @@ static void vorbis_cleanup(AVFormatContext *s, int idx)
struct ogg_stream *os = ogg->streams + idx;
struct oggvorbis_private *priv = os->private;
int i;
- if (os->private)
+ if (os->private) {
+ av_vorbis_parse_free(&priv->vp);
for (i = 0; i < 3; i++)
av_freep(&priv->packet[i]);
+ }
}
static int vorbis_update_metadata(AVFormatContext *s, int idx)
@@ -385,7 +387,9 @@ static int vorbis_header(AVFormatContext *s, int idx)
return ret;
}
st->codec->extradata_size = ret;
- if ((ret = avpriv_vorbis_parse_extradata(st->codec, &priv->vp))) {
+
+ priv->vp = av_vorbis_parse_init(st->codec->extradata, st->codec->extradata_size);
+ if (!priv->vp) {
av_freep(&st->codec->extradata);
st->codec->extradata_size = 0;
return ret;
@@ -411,10 +415,10 @@ static int vorbis_packet(AVFormatContext *s, int idx)
uint8_t *last_pkt = os->buf + os->pstart;
uint8_t *next_pkt = last_pkt;
- avpriv_vorbis_parse_reset(&priv->vp);
+ av_vorbis_parse_reset(priv->vp);
duration = 0;
seg = os->segp;
- d = avpriv_vorbis_parse_frame_flags(&priv->vp, last_pkt, 1, &flags);
+ d = av_vorbis_parse_frame_flags(priv->vp, last_pkt, 1, &flags);
if (d < 0) {
os->pflags |= AV_PKT_FLAG_CORRUPT;
return 0;
@@ -426,7 +430,7 @@ static int vorbis_packet(AVFormatContext *s, int idx)
last_pkt = next_pkt = next_pkt + os->psize;
for (; seg < os->nsegs; seg++) {
if (os->segments[seg] < 255) {
- int d = avpriv_vorbis_parse_frame_flags(&priv->vp, last_pkt, 1, &flags);
+ int d = av_vorbis_parse_frame_flags(priv->vp, last_pkt, 1, &flags);
if (d < 0) {
duration = os->granule;
break;
@@ -451,12 +455,12 @@ static int vorbis_packet(AVFormatContext *s, int idx)
s->streams[idx]->duration -= s->streams[idx]->start_time;
}
priv->final_pts = AV_NOPTS_VALUE;
- avpriv_vorbis_parse_reset(&priv->vp);
+ av_vorbis_parse_reset(priv->vp);
}
/* parse packet duration */
if (os->psize > 0) {
- duration = avpriv_vorbis_parse_frame_flags(&priv->vp, os->buf + os->pstart, 1, &flags);
+ duration = av_vorbis_parse_frame_flags(priv->vp, os->buf + os->pstart, 1, &flags);
if (duration < 0) {
os->pflags |= AV_PKT_FLAG_CORRUPT;
return 0;