<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">In data domenica 04 novembre 2012 14:26:56, Carl Eugen Hoyos ha scritto:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > Using valgrind I obtain a memory leak in this row:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> ></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > "pAVStream= add_video_stream(pAVFormatContext, &pAVCodec, </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > pAVOutputFormat->video_codec);"</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > if (posix_memalign(&ptr,ALIGN,size))</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > av_mallocz in mem.c:95</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Could you post the valgrind output?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">4 bytes in 1 blocks are definitely lost in loss record 1 of 6</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  in muxing(char const*) in main.cpp:275</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  1: malloc in /tmp/buildd/valgrind-3.6.0~svn11254+nmu1/coregrind/m_replacemalloc/vg_replace_malloc.c:236</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  2: realloc in /tmp/buildd/valgrind-3.6.0~svn11254+nmu1/coregrind/m_replacemalloc/vg_replace_malloc.c:525</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  3: avformat_new_stream in <a href="file:///home/denis/C++/ffmpeg-1.0/libavformat/utils.c:3138" </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>/home/denis/C++/ffmpeg-1.0/libavformat/utils.c:3138</a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  4: muxing(char const*) in <a href="file:///home/denis/C++/QtFFmpeg/QtFFmpegEncoder/C/C-build-desktop/../C/main.cpp:275" >main.cpp:275</a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  5: main in <a href="file:///home/denis/C++/QtFFmpeg/QtFFmpegEncoder/C/C-build-desktop/../C/main.cpp:324" >main.cpp:324</a></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The row 275 is below:</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-weight:600; color:#000000;">pAVStream=</span><span style=" font-weight:600; color:#c0c0c0;"> </span><span style=" font-weight:600;">add_video_stream</span><span style=" font-weight:600; color:#000000;">(pAVFormatContext,</span><span style=" font-weight:600; color:#c0c0c0;"> </span><span style=" font-weight:600; color:#000000;">&pAVCodec,</span><span style=" font-weight:600; color:#c0c0c0;"> </span><span style=" font-weight:600; color:#000000;">pAVOutputFormat-></span><span style=" font-weight:600; color:#800000;">video_codec</span><span style=" font-weight:600; color:#000000;">);</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; color:#000000;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" color:#000000;">that has the correspondent row</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; color:#000000;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-weight:600;">       close_video</span><span style=" font-weight:600; color:#000000;">(pAVFormatContext,</span><span style=" font-weight:600; color:#c0c0c0;"> </span><span style=" font-weight:600; color:#000000;">pAVStream);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">for</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">count=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span><span style=" color:#000000;">;</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">count<</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">pAVFormatContext-></span><span style=" color:#800000;">nb_streams</span><span style=" color:#000000;">;</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">count++)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier';">av_freep</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pAVFormatContext-></span><span style=" font-family:'Courier New,courier'; color:#800000;">streams</span><span style=" font-family:'Courier New,courier'; color:#000000;">[count]-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier';">av_freep</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pAVFormatContext-></span><span style=" font-family:'Courier New,courier'; color:#800000;">streams</span><span style=" font-family:'Courier New,courier'; color:#000000;">[count]);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#000000;">      }</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">     </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!(pAVOutputFormat-></span><span style=" font-family:'Courier New,courier'; color:#800000;">flags</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">&</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">AVFMT_NOFILE</span><span style=" font-family:'Courier New,courier'; color:#000000;">))</span><span style=" font-family:'Courier New,courier';">avio_close</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pAVFormatContext-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pb</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">      //</span><span style=" font-family:'Courier New,courier';">av_free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pAVFormatContext);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">       avformat_free_context<span style=" color:#000000;">(pAVFormatContext);</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';"><br /></span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-weight:600; color:#000000;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" color:#000000;">but valgrind says detects memory leak.</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; color:#000000;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">www.denisgottardello.it</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Skype: mrdebug</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Videosurveillance and home automation! </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php</p></body></html>