1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

vfwcap: Move vfw_read_close to avoid forward declaration.

Patch by Diego.

Originally committed as revision 19567 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Diego Biurrun 2009-08-02 17:39:10 +00:00 committed by Ramiro Polla
parent e4d65ba590
commit c959c6ee3d

View 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"),