1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

vfwcap: Free remaining packets on vfw_read_close().

Originally committed as revision 22575 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ramiro Polla 2010-03-17 04:36:06 +00:00
parent ce03ed4df1
commit ad8eede7b1

View File

@ -210,6 +210,7 @@ fail:
static int vfw_read_close(AVFormatContext *s)
{
struct vfw_ctx *ctx = s->priv_data;
AVPacketList *pktl;
if(ctx->hwnd) {
SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
@ -221,6 +222,14 @@ static int vfw_read_close(AVFormatContext *s)
if(ctx->event)
CloseHandle(ctx->event);
pktl = ctx->pktl;
while (pktl) {
AVPacketList *next = pktl->next;
av_destruct_packet(&pktl->pkt);
av_free(pktl);
pktl = next;
}
return 0;
}