From dc12fe5cab2ff57a5e25f35435e33fd11117fc72 Mon Sep 17 00:00:00 2001 From: Marcus Glocker Date: Sat, 4 Oct 2008 11:54:44 +0000 Subject: When closing the video stream switch back to default interface as last action. Shuts down the device gracefully. --- sys/dev/usb/uvideo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 0c6d8a402fe..55179385b99 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.85 2008/08/24 19:46:45 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.86 2008/10/04 11:54:43 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -1466,14 +1466,14 @@ uvideo_vs_open(struct uvideo_softc *sc) void uvideo_vs_close(struct uvideo_softc *sc) { - /* switch back to default interface (turns off cam LED) */ - (void)usbd_set_interface(sc->sc_vs_cur->ifaceh, 0); - if (sc->sc_vs_cur->pipeh) { usbd_abort_pipe(sc->sc_vs_cur->pipeh); usbd_close_pipe(sc->sc_vs_cur->pipeh); sc->sc_vs_cur->pipeh = NULL; } + + /* switch back to default interface (turns off cam LED) */ + (void)usbd_set_interface(sc->sc_vs_cur->ifaceh, 0); } usbd_status -- cgit v1.2.3