Click here to Skip to main content
14,271,845 members
Rate this:
Please Sign up or sign in to vote.
I got some question, in my code,
this project will get video stream from camera,
and encoder with ffmpeg lib and x264,
then both save in a .mp4 file, upload to rtmp server.

now, when I stop get stream and encode,
VS2012 show the memory leak, but it cant locate the memory leak code.

can someone help me?
Or tell me, it's ffmpeg lib issue or my code issue.
thanks!

It's my Code: http://ideone.com/NJwjfW

OnStartThred() Funtion is the master function,
I use _CrtDumpMemoryLeaks() to find memory leak.

One of the memory leak, its at "avformat_close_input(&pFormatCtx);"
even I set pFormatCtx = NULL, also has memory leak,
I try fix it, but I cant....

note: memory leak is like
{710} normal block at 0x004D5B30, 29 bytes long.
 Data: <  c             > 18 B9 63 01 0C 00 00 00 0C 00 00 00 01 00 00 00
{697} normal block at 0x0048F7D0, 58 bytes long.
 Data: <  c )   )       > 18 B9 63 01 29 00 00 00 29 00 00 00 01 00 00 00
{694} client block at 0x004C2728, subtype c0, 204 bytes long.
a CObject object at $004C2728, 204 bytes long
{687} normal block at 0x0048F758, 53 bytes long.
 Data: <  c $   $       > 18 B9 63 01 24 00 00 00 24 00 00 00 01 00 00 00
Object dump complete.
Posted
Updated 23-Jul-14 23:52pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100