]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/img.c
move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
[ffmpeg] / libavformat / img.c
index 25ac5119606da5931485d841cb67c499f8aec4e7..9c47d386266e20efb88d05c42e0fc2d2efe9fea0 100644 (file)
@@ -175,7 +175,7 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     st->codec.width = s->width;
     st->codec.height = s->height;
     st->codec.pix_fmt = s->pix_fmt;
-    s->img_size = avpicture_get_size(s->pix_fmt, s->width, s->height);
+    s->img_size = avpicture_get_size(s->pix_fmt, (s->width+15)&(~15), (s->height+15)&(~15));
 
     return 0;
  fail1:
@@ -193,7 +193,7 @@ static int read_packet_alloc_cb(void *opaque, AVImageInfo *info)
     if (info->width != s->width ||
         info->height != s->height)
         return -1;
-    avpicture_fill(&info->pict, s->ptr, info->pix_fmt, info->width, info->height);
+    avpicture_fill(&info->pict, s->ptr, info->pix_fmt, (info->width+15)&(~15), (info->height+15)&(~15));
     return 0;
 }
 
@@ -236,7 +236,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
     } else {
         /* XXX: computing this pts is not necessary as it is done in
            the generic code too */
-        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec.frame_rate_base, s1->pts_den, s1->streams[0]->codec.frame_rate) / s1->pts_num;
+        pkt->pts = av_rescale((int64_t)s->img_count * s1->streams[0]->codec.frame_rate_base, s1->streams[0]->time_base.den, s1->streams[0]->codec.frame_rate) / s1->streams[0]->time_base.num;
         s->img_count++;
         s->img_number++;
         return 0;