From 77be08eeb199c8f3f78b3426e970decadbc1425c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Thu, 6 Nov 2008 01:50:56 +0000 Subject: OGG: untypedef demuxer structs Originally committed as revision 15784 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/oggdec.c | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'libavformat/oggdec.c') diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 5176f6dd0e..08712f6989 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -37,7 +37,7 @@ #define MAX_PAGE_SIZE 65307 #define DECODER_BUFFER_SIZE MAX_PAGE_SIZE -static const ogg_codec_t * const ogg_codecs[] = { +static const struct ogg_codec * const ogg_codecs[] = { &ff_speex_codec, &ff_vorbis_codec, &ff_theora_codec, @@ -54,8 +54,8 @@ static const ogg_codec_t * const ogg_codecs[] = { static int ogg_save (AVFormatContext * s) { - ogg_t *ogg = s->priv_data; - ogg_state_t *ost = + struct ogg *ogg = s->priv_data; + struct ogg_state *ost = av_malloc(sizeof (*ost) + (ogg->nstreams-1) * sizeof (*ogg->streams)); int i; ost->pos = url_ftell (s->pb); @@ -65,7 +65,7 @@ ogg_save (AVFormatContext * s) memcpy(ost->streams, ogg->streams, ogg->nstreams * sizeof(*ogg->streams)); for (i = 0; i < ogg->nstreams; i++){ - ogg_stream_t *os = ogg->streams + i; + struct ogg_stream *os = ogg->streams + i; os->buf = av_malloc (os->bufsize); memset (os->buf, 0, os->bufsize); memcpy (os->buf, ost->streams[i].buf, os->bufpos); @@ -79,9 +79,9 @@ ogg_save (AVFormatContext * s) static int ogg_restore (AVFormatContext * s, int discard) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; ByteIOContext *bc = s->pb; - ogg_state_t *ost = ogg->state; + struct ogg_state *ost = ogg->state; int i; if (!ost) @@ -106,12 +106,12 @@ ogg_restore (AVFormatContext * s, int discard) } static int -ogg_reset (ogg_t * ogg) +ogg_reset (struct ogg * ogg) { int i; for (i = 0; i < ogg->nstreams; i++){ - ogg_stream_t *os = ogg->streams + i; + struct ogg_stream *os = ogg->streams + i; os->bufpos = 0; os->pstart = 0; os->psize = 0; @@ -126,7 +126,7 @@ ogg_reset (ogg_t * ogg) return 0; } -static const ogg_codec_t * +static const struct ogg_codec * ogg_find_codec (uint8_t * buf, int size) { int i; @@ -140,7 +140,7 @@ ogg_find_codec (uint8_t * buf, int size) } static int -ogg_find_stream (ogg_t * ogg, int serial) +ogg_find_stream (struct ogg * ogg, int serial) { int i; @@ -155,10 +155,10 @@ static int ogg_new_stream (AVFormatContext * s, uint32_t serial) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; int idx = ogg->nstreams++; AVStream *st; - ogg_stream_t *os; + struct ogg_stream *os; ogg->streams = av_realloc (ogg->streams, ogg->nstreams * sizeof (*ogg->streams)); @@ -179,9 +179,9 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) } static int -ogg_new_buf(ogg_t *ogg, int idx) +ogg_new_buf(struct ogg *ogg, int idx) { - ogg_stream_t *os = ogg->streams + idx; + struct ogg_stream *os = ogg->streams + idx; uint8_t *nb = av_malloc(os->bufsize); int size = os->bufpos - os->pstart; if(os->buf){ @@ -199,8 +199,8 @@ static int ogg_read_page (AVFormatContext * s, int *str) { ByteIOContext *bc = s->pb; - ogg_t *ogg = s->priv_data; - ogg_stream_t *os; + struct ogg *ogg = s->priv_data; + struct ogg_stream *os; int i = 0; int flags, nsegs; uint64_t gp; @@ -302,9 +302,9 @@ ogg_read_page (AVFormatContext * s, int *str) static int ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; int idx; - ogg_stream_t *os; + struct ogg_stream *os; int complete = 0; int segp = 0, psize = 0; @@ -402,7 +402,7 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize) static int ogg_get_headers (AVFormatContext * s) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; do{ if (ogg_packet (s, NULL, NULL, NULL) < 0) @@ -419,8 +419,8 @@ ogg_get_headers (AVFormatContext * s) static uint64_t ogg_gptopts (AVFormatContext * s, int i, uint64_t gp) { - ogg_t *ogg = s->priv_data; - ogg_stream_t *os = ogg->streams + i; + struct ogg *ogg = s->priv_data; + struct ogg_stream *os = ogg->streams + i; uint64_t pts = AV_NOPTS_VALUE; if(os->codec->gptopts){ @@ -436,7 +436,7 @@ ogg_gptopts (AVFormatContext * s, int i, uint64_t gp) static int ogg_get_length (AVFormatContext * s) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; int idx = -1, i; int64_t size, end; @@ -476,7 +476,7 @@ ogg_get_length (AVFormatContext * s) static int ogg_read_header (AVFormatContext * s, AVFormatParameters * ap) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; ogg->curidx = -1; //linear headers seek from start if (ogg_get_headers (s) < 0){ @@ -494,8 +494,8 @@ ogg_read_header (AVFormatContext * s, AVFormatParameters * ap) static int ogg_read_packet (AVFormatContext * s, AVPacket * pkt) { - ogg_t *ogg; - ogg_stream_t *os; + struct ogg *ogg; + struct ogg_stream *os; int idx = -1; int pstart, psize; @@ -527,7 +527,7 @@ ogg_read_packet (AVFormatContext * s, AVPacket * pkt) static int ogg_read_close (AVFormatContext * s) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; int i; for (i = 0; i < ogg->nstreams; i++){ @@ -543,7 +543,7 @@ static int64_t ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg, int64_t pos_limit) { - ogg_t *ogg = s->priv_data; + struct ogg *ogg = s->priv_data; ByteIOContext *bc = s->pb; int64_t pts = AV_NOPTS_VALUE; int i; @@ -575,7 +575,7 @@ static int ogg_probe(AVProbeData *p) AVInputFormat ogg_demuxer = { "ogg", NULL_IF_CONFIG_SMALL("Ogg"), - sizeof (ogg_t), + sizeof (struct ogg), ogg_probe, ogg_read_header, ogg_read_packet, -- cgit v1.2.3