mirror of https://github.com/mpv-player/mpv
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:
parent
a6e05bcdbb
commit
40e196f4a6
|
@ -857,6 +857,7 @@ static int uninit(priv_t *priv)
|
|||
int i, frames, dropped = 0;
|
||||
|
||||
priv->shutdown = 1;
|
||||
if(priv->video_grabber_thread)
|
||||
pthread_join(priv->video_grabber_thread, NULL);
|
||||
pthread_mutex_destroy(&priv->video_buffer_mutex);
|
||||
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue