Commit 83af30dd authored by Jean-Paul Saman's avatar 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.
parent 05a0de39
...@@ -2294,6 +2294,10 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux ) ...@@ -2294,6 +2294,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_num = p_sys->i_aspect * es_fmt.video.i_height;
es_fmt.video.i_sar_den = VOUT_ASPECT_FACTOR * es_fmt.video.i_width; 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; demux_t *p_demux = (demux_t *) p_obj;
msg_Dbg( p_demux, "added new video es %4.4s %dx%d", 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 ); (char*)&es_fmt.i_codec, es_fmt.video.i_width, es_fmt.video.i_height );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment