[vlc-devel] Suggested Patch: modules/access/v4l.c

James MacLean macleajb at ednet.ns.ca
Tue Apr 13 23:07:46 CEST 2004


Problem:
  Buffer being returned in GrabCapture() was off by one. Returning buffer
  that has yet to be filled.

Suggested patch:

--- modules/access/v4l/v4lold.c	2004-04-13 18:02:43.344472516 -0300
+++ modules/access/v4l/v4l.c	2004-04-13 18:03:24.306146235 -0300
@@ -1289,6 +1289,7 @@
 static uint8_t *GrabCapture( input_thread_t *p_input )
 {
     access_sys_t *p_sys = p_input->p_access_data;
+    uint8_t offset = p_sys->i_frame_pos;
     p_sys->vid_mmap.frame = ( p_sys->i_frame_pos + 1 ) %
                             p_sys->vid_mbuf.frames;
     for( ;; )
@@ -1313,7 +1314,7 @@
 
     p_sys->i_frame_pos = p_sys->vid_mmap.frame;
     /* leave i_video_frame_size alone */
-    return p_sys->p_video_mmap + p_sys->vid_mbuf.offsets[p_sys->i_frame_pos];
+    return p_sys->p_video_mmap + p_sys->vid_mbuf.offsets[offset];
 }
 
 static uint8_t *GrabMJPEG( input_thread_t *p_input )
---

With this patch I can now do 640x480 streams with out stalls. Am I on the 
right track :)?

JES
-- 
James B. MacLean        macleajb at ednet.ns.ca
Department of Education 
Nova Scotia, Canada
     

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list