armbox: tryfix lost of video device after playing something with gst

Origin commit data
------------------
Branch: master
Commit: 99eb4a3c7f
Author: TangoCash <eric@loxat.de>
Date: 2017-10-18 (Wed, 18 Oct 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-10-18 21:05:28 +02:00
parent c192f6a655
commit 23b5ef5a72

View File

@@ -189,6 +189,8 @@ retry:
}
lt_info("#%d: %s cannot open %s: %m, retries %d\n", devnum, __func__, VDEV[devnum], n);
}
ioctl(fd, VIDEO_STOP, 0);
ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX);
playstate = VIDEO_STOPPED;
}
@@ -197,6 +199,10 @@ void cVideo::closeDevice(void)
lt_debug("%s\n", __func__);
/* looks like sometimes close is unhappy about non-empty buffers */
Start();
ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY);
ioctl(fd, VIDEO_PLAY);
ioctl(fd, VIDEO_CONTINUE);
ioctl(fd, VIDEO_CLEAR_BUFFER);
if (fd >= 0)
close(fd);
fd = -1;