[vlc-commits] commit: access/v4l2.c: Tell vlc what framerate the device delivers ( Jean-Paul Saman )

git at videolan.org git at videolan.org
Tue Dec 14 13:23:04 CET 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Fri Dec  3 16:11:26 2010 +0100| [d69f518633db434da752ce4272d97431465d6e3c] | committer: Jean-Paul Saman 

access/v4l2.c: Tell vlc what framerate the device delivers

The framerate as specified by the user or detected by the v4l2 access input was
overwritten by the rawvideo decoder. The module did not specify:

	es_fmt.video.i_frame_rate
	es_fmt.video.i_frame_rate_base

Their default values are 0. The rawvideo decoder detects that there is no framerate
specified and resorts to its own default (fps 25.0). Through setting framerate and
framerate_base in the v4l2 es format the correct fps is communicated to vlc core.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d69f518633db434da752ce4272d97431465d6e3c
---

 modules/access/v4l2.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index 7d79b41..9dcab74 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -2292,6 +2292,10 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
         es_fmt.video.i_sar_num = p_sys->i_aspect    * es_fmt.video.i_height;
         es_fmt.video.i_sar_den = VOUT_ASPECT_FACTOR * es_fmt.video.i_width;
 
+        /* Framerate */
+        es_fmt.video.i_frame_rate = p_sys->f_fps * INT64_C(1000000);
+        es_fmt.video.i_frame_rate_base = INT64_C(1000000);
+
         demux_t *p_demux = (demux_t *) p_obj;
         msg_Dbg( p_demux, "added new video es %4.4s %dx%d",
             (char*)&es_fmt.i_codec, es_fmt.video.i_width, es_fmt.video.i_height );



More information about the vlc-commits mailing list