]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsetheora.c
fate: Add hap-chunk ref file
[ffmpeg] / libavformat / oggparsetheora.c
index 961096edaa59e408f9b6fe892d1c3c0eabf01e6a..01d1518c2a38beda3d8cb3ee096ce6a690cdb471 100644 (file)
@@ -58,7 +58,6 @@ static int theora_header(AVFormatContext *s, int idx)
     switch (os->buf[os->pstart]) {
     case 0x80: {
         GetBitContext gb;
-        int width, height;
         AVRational timebase;
 
         init_get_bits(&gb, os->buf + os->pstart, os->psize * 8);
@@ -73,19 +72,20 @@ static int theora_header(AVFormatContext *s, int idx)
             return AVERROR(ENOSYS);
         }
 
-        width  = get_bits(&gb, 16) << 4;
-        height = get_bits(&gb, 16) << 4;
-        avcodec_set_dimensions(st->codec, width, height);
+        st->codec->width  = get_bits(&gb, 16) << 4;
+        st->codec->height = get_bits(&gb, 16) << 4;
 
         if (thp->version >= 0x030400)
             skip_bits(&gb, 100);
 
         if (thp->version >= 0x030200) {
-            width  = get_bits_long(&gb, 24);
-            height = get_bits_long(&gb, 24);
+            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)
-                avcodec_set_dimensions(st->codec, width, height);
+                height <= st->codec->height && height > st->codec->height - 16) {
+                st->codec->width  = width;
+                st->codec->height = height;
+            }
 
             skip_bits(&gb, 16);
         }
@@ -116,7 +116,7 @@ static int theora_header(AVFormatContext *s, int idx)
     }
     break;
     case 0x81:
-        ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7, os->psize - 7);
+        ff_vorbis_stream_comment(s, st, os->buf + os->pstart + 7, os->psize - 7);
     case 0x82:
         if (!thp->version)
             return AVERROR_INVALIDDATA;
@@ -126,7 +126,7 @@ static int theora_header(AVFormatContext *s, int idx)
     }
 
     if ((err = av_reallocp(&st->codec->extradata,
-                           cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
+                           cds + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
         st->codec->extradata_size = 0;
         return err;
     }