Commit 426dca4c authored by ramiro's avatar ramiro

vfwcap: Move vfw_read_close to avoid forward declaration.

Patch by Diego.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19567 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6391cc3a
...@@ -201,7 +201,22 @@ fail: ...@@ -201,7 +201,22 @@ fail:
return FALSE; 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) static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
...@@ -402,23 +417,6 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -402,23 +417,6 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
return pkt->size; 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 = { AVInputFormat vfwcap_demuxer = {
"vfwcap", "vfwcap",
NULL_IF_CONFIG_SMALL("VFW video capture"), NULL_IF_CONFIG_SMALL("VFW video capture"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment