do not crash when /dev/video0 is not present

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16186 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
faust3 2005-08-06 18:19:58 +00:00
parent a6e05bcdbb
commit 40e196f4a6
1 changed files with 3 additions and 2 deletions

View File

@ -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) {