diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-08-06 18:19:58 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-08-06 18:19:58 +0000 |
commit | 40e196f4a61b0ced042a8a2c79b300c46145b436 (patch) | |
tree | 6263e62c73f6a4166e6204410d4a7b166297457c /libmpdemux | |
parent | a6e05bcdbbb9a4a9424b3e528e361abc5ed8aa10 (diff) | |
download | mpv-40e196f4a61b0ced042a8a2c79b300c46145b436.tar.bz2 mpv-40e196f4a61b0ced042a8a2c79b300c46145b436.tar.xz |
do not crash when /dev/video0 is not present
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16186 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/tvi_v4l2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libmpdemux/tvi_v4l2.c b/libmpdemux/tvi_v4l2.c index d33fc70d08..1508e14285 100644 --- a/libmpdemux/tvi_v4l2.c +++ b/libmpdemux/tvi_v4l2.c @@ -857,7 +857,8 @@ static int uninit(priv_t *priv) int i, frames, dropped = 0; priv->shutdown = 1; - pthread_join(priv->video_grabber_thread, NULL); + if(priv->video_grabber_thread) + pthread_join(priv->video_grabber_thread, NULL); pthread_mutex_destroy(&priv->video_buffer_mutex); if (priv->streamon) { @@ -906,7 +907,7 @@ static int uninit(priv_t *priv) /* free memory and close device */ free(priv->map); priv->map = NULL; priv->mapcount = 0; - close(priv->video_fd); priv->video_fd = -1; + if(priv->video_fd!=-1)close(priv->video_fd); priv->video_fd = -1; free(priv->video_dev); priv->video_dev = NULL; if (priv->video_ringbuffer) { |