]> git.sesse.net Git - ffmpeg/commitdiff
fbdev,v4l2: remove some forgotten uses of AVFormatParameters.time_base.
authorAnton Khirnov <anton@khirnov.net>
Fri, 3 Jun 2011 11:29:43 +0000 (13:29 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 4 Jun 2011 17:48:08 +0000 (19:48 +0200)
libavdevice/fbdev.c
libavdevice/v4l2.c

index 58b3ab4572020bba66ff8288db325274ffa64cd8..7e9ffe5c77533f64f8428b6564800d18b6b1a2f7 100644 (file)
@@ -169,7 +169,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
     st->codec->width      = fbdev->width;
     st->codec->height     = fbdev->heigth;
     st->codec->pix_fmt    = pix_fmt;
-    st->codec->time_base  = ap->time_base;
+    st->codec->time_base  = (AVRational){fbdev->fps.den, fbdev->fps.num};
     st->codec->bit_rate   =
         fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->fps) * 8;
 
index 0cd4f38389e2f7f1998a512758a2211138f3a7e0..98ff82ec0dfc0130d398d87a5eaa9dc02b47f0bb 100644 (file)
@@ -546,6 +546,8 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
             return AVERROR(errno);
         }
     }
+    s1->streams[0]->codec->time_base.den = tpf->denominator;
+    s1->streams[0]->codec->time_base.num = tpf->numerator;
 
     return 0;
 }
@@ -679,8 +681,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     st->codec->codec_id = codec_id;
     st->codec->width = s->width;
     st->codec->height = s->height;
-    st->codec->time_base.den = ap->time_base.den;
-    st->codec->time_base.num = ap->time_base.num;
     st->codec->bit_rate = s->frame_size * 1/av_q2d(st->codec->time_base) * 8;
 
 out: