[Mplayer-cvslog] CVS: main/libmpdemux tvi_v4l.c,1.61,1.62

D Richard Felker III dalias at aerifal.cx
Sun Mar 30 22:02:46 CEST 2003


On Sun, Mar 30, 2003 at 07:06:05PM +0200, Alban Bedel CVS wrote:
> Update of /cvsroot/mplayer/main/libmpdemux
> In directory mail:/var/tmp.root/cvs-serv4377/libmpdemux
> 
> Modified Files:
> 	tvi_v4l.c 
> Log Message:
> 10L, close isn't enouth we must munmap too.
> 
> 
> Index: tvi_v4l.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/tvi_v4l.c,v
> retrieving revision 1.61
> retrieving revision 1.62
> diff -u -r1.61 -r1.62
> --- tvi_v4l.c	23 Mar 2003 15:05:14 -0000	1.61
> +++ tvi_v4l.c	30 Mar 2003 17:05:58 -0000	1.62
> @@ -679,7 +679,15 @@
>              mp_msg(MSGT_TV, MSGL_ERR, "\n  MJP: ioctl MJPIOC_QBUF_CAPT failed: %s\n", strerror(errno));
>            }
>        }
> -    close(priv->video_fd);
> +    else
> +      {
> +	// We need to munmap as close don't close mem mappings
> +	if(munmap(priv->mmap,priv->mbuf.size))
> +	  mp_msg(MSGT_TV, MSGL_ERR, "Munmap failed: %s\n",strerror(errno));
> +      }
> +
> +    if(close(priv->video_fd))
> +      mp_msg(MSGT_TV, MSGL_ERR, "Close tv failed: %s\n",strerror(errno));

AFAIK, the only error close can return is "bad fd" (i.e. you passed it
a number that's not a fd), so checking for error is probably
pointless.

Rich



More information about the MPlayer-cvslog mailing list