]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsetheora.c
Merge commit '4426540f0c3ee516662f79d0a6ab5b95503b6611'
[ffmpeg] / libavformat / oggparsetheora.c
index 5f057c3c8a2bbfdc9bf9dbb30b7c2276837522eb..b14f9f0669c1addc191b42b42411bdef7fd3dd05 100644 (file)
@@ -41,7 +41,7 @@ static int theora_header(AVFormatContext *s, int idx)
     struct ogg_stream *os = ogg->streams + idx;
     AVStream *st          = s->streams[idx];
     TheoraParams *thp     = os->private;
-    int cds               = st->codec->extradata_size + os->psize + 2;
+    int cds               = st->codecpar->extradata_size + os->psize + 2;
     int err;
     uint8_t *cdp;
 
@@ -72,8 +72,8 @@ static int theora_header(AVFormatContext *s, int idx)
             return AVERROR(ENOSYS);
         }
 
-        st->codec->width  = get_bits(&gb, 16) << 4;
-        st->codec->height = get_bits(&gb, 16) << 4;
+        st->codecpar->width  = get_bits(&gb, 16) << 4;
+        st->codecpar->height = get_bits(&gb, 16) << 4;
 
         if (thp->version >= 0x030400)
             skip_bits(&gb, 100);
@@ -81,10 +81,10 @@ static int theora_header(AVFormatContext *s, int idx)
         if (thp->version >= 0x030200) {
             int width  = get_bits_long(&gb, 24);
             int height = get_bits_long(&gb, 24);
-            if (width  <= st->codec->width  && width  > st->codec->width  - 16 &&
-                height <= st->codec->height && height > st->codec->height - 16) {
-                st->codec->width  = width;
-                st->codec->height = height;
+            if (width  <= st->codecpar->width  && width  > st->codecpar->width  - 16 &&
+                height <= st->codecpar->height && height > st->codecpar->height - 16) {
+                st->codecpar->width  = width;
+                st->codecpar->height = height;
             }
 
             skip_bits(&gb, 16);
@@ -110,8 +110,8 @@ static int theora_header(AVFormatContext *s, int idx)
         thp->gpshift = get_bits(&gb, 5);
         thp->gpmask  = (1U << thp->gpshift) - 1;
 
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = AV_CODEC_ID_THEORA;
+        st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+        st->codecpar->codec_id   = AV_CODEC_ID_THEORA;
         st->need_parsing      = AVSTREAM_PARSE_HEADERS;
     }
     break;
@@ -126,18 +126,18 @@ static int theora_header(AVFormatContext *s, int idx)
         return AVERROR_INVALIDDATA;
     }
 
-    if ((err = av_reallocp(&st->codec->extradata,
+    if ((err = av_reallocp(&st->codecpar->extradata,
                            cds + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
-        st->codec->extradata_size = 0;
+        st->codecpar->extradata_size = 0;
         return err;
     }
-    memset(st->codec->extradata + cds, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+    memset(st->codecpar->extradata + cds, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
-    cdp    = st->codec->extradata + st->codec->extradata_size;
+    cdp    = st->codecpar->extradata + st->codecpar->extradata_size;
     *cdp++ = os->psize >> 8;
     *cdp++ = os->psize & 0xff;
     memcpy(cdp, os->buf + os->pstart, os->psize);
-    st->codec->extradata_size = cds;
+    st->codecpar->extradata_size = cds;
 
     return 1;
 }