[FFmpeg-devel] A patch for gdigrab function

Michael Niedermayer michaelni at gmx.at
Sun Aug 17 00:17:37 CEST 2014


On Fri, Aug 08, 2014 at 05:08:46PM +0800, hlszl1983 at 163.com wrote:
> hi, all
> 
> I'm using gdigrab feature on windows, and found that the count of gdi objects owned by ffmpeg.exe increasing endlessly...
>  
> Here is the patch, can someone commit it?
> ----------------------------------------------
> diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c 
> index bccfef2..e2bed14 100644 
> --- a/libavdevice/gdigrab.c 
> +++ b/libavdevice/gdigrab.c 
> @@ -451,6 +451,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab) 
> icon = CopyCursor(LoadCursor(NULL, IDC_ARROW)); 
> } 
> 
> + /*Remarks 
> + *GetIconInfo creates bitmaps for the hbmMask and hbmColor members of ICONINFO. 
> + *The calling application must manage these bitmaps and delete them when they are no longer necessary. 
> + */ 
> if (!GetIconInfo(icon, &info)) { 
> CURSOR_ERROR("Could not get icon info"); 
> goto icon_error; 
> @@ -481,6 +485,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab) 
> } 
> 
> icon_error: 
> + if (info.hbmMask) 
> + DeleteObject(info.hbmMask); 
> + if(info.hbmColor) 
> + DeleteObject(info.hbmColor); 
> if (icon) 
> DestroyCursor(icon); 
> } else {

the patch has been mangled, probably by your mail user agent

also CC-ing maintainer

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140817/4243ab56/attachment.asc>


More information about the ffmpeg-devel mailing list