]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rmdec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / rmdec.c
index 0d88e765d132a11cdd4c02cbce66bbc4534edc92..75240236e8a5d7a34dccaf089759c30350bc5e91 100644 (file)
@@ -23,6 +23,8 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/dict.h"
 #include "avformat.h"
+#include "internal.h"
+#include "avio_internal.h"
 #include "riff.h"
 #include "rm.h"
 
@@ -302,7 +304,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
     int64_t codec_pos;
     int ret;
 
-    av_set_pts_info(st, 64, 1, 1000);
+    avpriv_set_pts_info(st, 64, 1, 1000);
     codec_pos = avio_tell(pb);
     v = avio_rb32(pb);
     if (v == MKTAG(0xfd, 'a', 'r', '.')) {
@@ -313,7 +315,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
         int fps;
         if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
         fail1:
-            av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n");
+            av_log(s, AV_LOG_WARNING, "Unsupported stream type %08x\n", v);
             goto skip;
         }
         st->codec->codec_tag = avio_rl32(pb);
@@ -333,10 +335,9 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
         if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
             return ret;
 
-        av_reduce(&st->codec->time_base.num, &st->codec->time_base.den,
+        av_reduce(&st->r_frame_rate.den, &st->r_frame_rate.num,
                   0x10000, fps, (1 << 30) - 1);
-        st->avg_frame_rate.num = st->codec->time_base.den;
-        st->avg_frame_rate.den = st->codec->time_base.num;
+        st->avg_frame_rate = st->r_frame_rate;
     }
 
 skip:
@@ -612,6 +613,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
     }
     if(type != 1){  // not whole frame
         len2 = get_num(pb, &len);
+        len2 = ffio_limit(pb, len2);
         pos  = get_num(pb, &len);
         pic_num = avio_r8(pb); len--;
     }