vfwcap: Move vfw_read_close to avoid forward declaration.
authorDiego Biurrun <diego@biurrun.de>
Sun, 2 Aug 2009 17:39:10 +0000 (17:39 +0000)
committerRamiro Polla <ramiro.polla@gmail.com>
Sun, 2 Aug 2009 17:39:10 +0000 (17:39 +0000)
Patch by Diego.

Originally committed as revision 19567 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavdevice/vfwcap.c

index 4a027225bdf20aeb243cd1bc18375138a7cdc6c6..5dee0e0140c34dbd4b6ca96bfcfd7048edd00b1e 100644 (file)
@@ -201,7 +201,22 @@ fail:
     return FALSE;
 }
 
-static int vfw_read_close(AVFormatContext *s);
+static int vfw_read_close(AVFormatContext *s)
+{
+    struct vfw_ctx *ctx = s->priv_data;
+
+    if(ctx->hwnd) {
+        SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
+        SendMessage(ctx->hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
+        DestroyWindow(ctx->hwnd);
+    }
+    if(ctx->mutex)
+        CloseHandle(ctx->mutex);
+    if(ctx->event)
+        CloseHandle(ctx->event);
+
+    return 0;
+}
 
 static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
@@ -402,23 +417,6 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
     return pkt->size;
 }
 
-static int vfw_read_close(AVFormatContext *s)
-{
-    struct vfw_ctx *ctx = s->priv_data;
-
-    if(ctx->hwnd) {
-        SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
-        SendMessage(ctx->hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
-        DestroyWindow(ctx->hwnd);
-    }
-    if(ctx->mutex)
-        CloseHandle(ctx->mutex);
-    if(ctx->event)
-        CloseHandle(ctx->event);
-
-    return 0;
-}
-
 AVInputFormat vfwcap_demuxer = {
     "vfwcap",
     NULL_IF_CONFIG_SMALL("VFW video capture"),