]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsetheora.c
wv: return AVERROR_EOF on EOF, not EIO.
[ffmpeg] / libavformat / oggparsetheora.c
index d02781f2fa3a37e3a6142c0dd787ad28ab2bba1e..d1559f4632da8ada7972b1a96ebedba5a26297ca 100644 (file)
@@ -26,6 +26,7 @@
 #include "libavutil/bswap.h"
 #include "libavcodec/get_bits.h"
 #include "avformat.h"
+#include "internal.h"
 #include "oggdec.h"
 
 struct theora_params {
@@ -55,6 +56,7 @@ theora_header (AVFormatContext * s, int idx)
     if (os->buf[os->pstart] == 0x80) {
         GetBitContext gb;
         int width, height;
+        AVRational timebase;
 
         init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
 
@@ -84,14 +86,14 @@ theora_header (AVFormatContext * s, int idx)
 
             skip_bits(&gb, 16);
         }
-        st->codec->time_base.den = get_bits_long(&gb, 32);
-        st->codec->time_base.num = get_bits_long(&gb, 32);
-        if (!(st->codec->time_base.num > 0 && st->codec->time_base.den > 0)) {
+        timebase.den = get_bits_long(&gb, 32);
+        timebase.num = get_bits_long(&gb, 32);
+        if (!(timebase.num > 0 && timebase.den > 0)) {
             av_log(s, AV_LOG_WARNING, "Invalid time base in theora stream, assuming 25 FPS\n");
-            st->codec->time_base.num = 1;
-            st->codec->time_base.den = 25;
+            timebase.num = 1;
+            timebase.den = 25;
         }
-        av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
+        avpriv_set_pts_info(st, 64, timebase.num, timebase.den);
 
         st->sample_aspect_ratio.num = get_bits_long(&gb, 24);
         st->sample_aspect_ratio.den = get_bits_long(&gb, 24);