diff oggdec.c @ 4016:6cd006bc2de9 libavformat

OGG: untypedef demuxer structs
author mru
date Thu, 06 Nov 2008 01:50:56 +0000
parents 549a09cf23fe
children 187c981dfcb0
line wrap: on
line diff
--- a/oggdec.c	Wed Nov 05 09:22:13 2008 +0000
+++ b/oggdec.c	Thu Nov 06 01:50:56 2008 +0000
@@ -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 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 @@
     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 @@
 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 @@
 }
 
 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 @@
     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 @@
 }
 
 static int
-ogg_find_stream (ogg_t * ogg, int serial)
+ogg_find_stream (struct ogg * ogg, int serial)
 {
     int i;
 
@@ -155,10 +155,10 @@
 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 @@
 }
 
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 AVInputFormat ogg_demuxer = {
     "ogg",
     NULL_IF_CONFIG_SMALL("Ogg"),
-    sizeof (ogg_t),
+    sizeof (struct ogg),
     ogg_probe,
     ogg_read_header,
     ogg_read_packet,