summaryrefslogtreecommitdiff
path: root/libavdevice/vfwcap.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2009-08-02 17:39:10 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2009-08-02 17:39:10 +0000
commitc959c6ee3dba0bd54bcdb7679cca8b5f3560550d (patch)
tree20aba9b894da71d070c77dd1a1e206dc2012c303 /libavdevice/vfwcap.c
parente4d65ba590818f6cb656f86202ec0241d2831ad8 (diff)
vfwcap: Move vfw_read_close to avoid forward declaration.
Patch by Diego. Originally committed as revision 19567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice/vfwcap.c')
-rw-r--r--libavdevice/vfwcap.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
index 4a027225bd..5dee0e0140 100644
--- a/libavdevice/vfwcap.c
+++ b/libavdevice/vfwcap.c
@@ -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"),