diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2010-03-17 04:36:06 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2010-03-17 04:36:06 +0000 |
commit | ad8eede7b1dd0578d4b69c0e2a41d9276e9e127d (patch) | |
tree | e10ed63b340d5c48b380d2a11be8af1d88023400 /libavdevice/vfwcap.c | |
parent | ce03ed4df1d8f0fc8f48402886a6dfb0b7099509 (diff) | |
download | ffmpeg-ad8eede7b1dd0578d4b69c0e2a41d9276e9e127d.tar.gz |
vfwcap: Free remaining packets on vfw_read_close().
Originally committed as revision 22575 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice/vfwcap.c')
-rw-r--r-- | libavdevice/vfwcap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 92e5925756..9f242f80f9 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -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; } |