]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpsubdec.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / mpsubdec.c
index e7b83a1d85f1f5531392646fcc5fdd164e202169..ee53be17d652b24904a313b90b4a1cf2232df17d 100644 (file)
@@ -72,8 +72,8 @@ static int parse_line(const char *line, int64_t *value, int64_t *value2)
                 fracval *= 10;
             for (;p2 - p1 > 7 + 1; p1++)
                 fracval /= 10;
-            if (intval > 0) intval += fracval;
-            else            intval -= fracval;
+            if (intval > 0) intval = av_sat_add64(intval, fracval);
+            else            intval = av_sat_sub64(intval, fracval);
             line += p2;
         } else
             line += p1;
@@ -147,8 +147,8 @@ static int mpsub_read_header(AVFormatContext *s)
     if (common_factor > 1) {
         common_factor = av_gcd(pts_info.num, common_factor);
         for (i = 0; i < mpsub->q.nb_subs; i++) {
-            mpsub->q.subs[i].pts      /= common_factor;
-            mpsub->q.subs[i].duration /= common_factor;
+            mpsub->q.subs[i]->pts      /= common_factor;
+            mpsub->q.subs[i]->duration /= common_factor;
         }
         pts_info.num /= common_factor;
     }
@@ -193,7 +193,7 @@ static int mpsub_read_close(AVFormatContext *s)
     return 0;
 }
 
-AVInputFormat ff_mpsub_demuxer = {
+const AVInputFormat ff_mpsub_demuxer = {
     .name           = "mpsub",
     .long_name      = NULL_IF_CONFIG_SMALL("MPlayer subtitles"),
     .priv_data_size = sizeof(MPSubContext),