<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Okay, so final mail (sorry!)<br>
    I finally solved my problem, after some hours of research: for audio
    files with pictures embedded in tags, they were indeed detected and
    set into the first frame, but it was not an audioStream (of course!)
    so I had to add an « else » clause to my decode loop, like this:<br>
    <br>
        while(av_read_frame(pFormatCtx, &avpkt) >= 0) {<br>
            if(avpkt.stream_index == audioStream)<br>
                (...)<br>
            else<br>
                av_free_packet(&avpkt); /* Dropping the damn album
    cover */<br>
    <br>
    So, thanks very much for the help!<br>
    <br>
    <div class="moz-cite-prefix">Le 30/08/2015 17:55, Polochon Street a
      écrit :<br>
    </div>
    <blockquote cite="mid:55E32765.1050407@gmx.fr" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Sorry for answering my own mail, but I've been finally able to
      obtain a full trace, thanks to --disable-stripping and some
      options of a PKGBUILD:<br>
      <br>
      ==3250== 4,793 (24 direct, 4,769 indirect) bytes in 1 blocks are
      definitely lost in loss record 235 of 237<br>
      ==3250==    at 0x4C2AED6: memalign (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
      ==3250==    by 0x4C2AFF1: posix_memalign (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
      ==3250==    by 0x554442F: av_malloc (mem.c:97)<br>
      ==3250==    by 0x55445FD: av_mallocz (mem.c:254)<br>
      ==3250==    by 0x5533DED: av_buffer_ref (buffer.c:94)<br>
      ==3250==    by 0x5281FF2: avformat_queue_attached_pictures
      (utils.c:395)<br>
      ==3250==    by 0x528C767: avformat_open_input (utils.c:486)<br>
      ==3250==    by 0x4021DD: audio_decode (decode.c:23)<br>
      ==3250==    by 0x4019F7: analyze (analyze.c:30)<br>
      ==3250==    by 0x401865: main (gui_dummy.c:24)<br>
      <br>
      It seems that I'm not freeing all of my AVFormatCtx streams
      properly, but I'm using avformat_close_input(&pFormatCtx) and
      avformat_free_context(pFormatCtx), am I missing something?<br>
      <br>
      <div class="moz-cite-prefix">Le 29/08/2015 20:40, Polochon Street
        a écrit :<br>
      </div>
      <blockquote cite="mid:55E1FC9C.8000407@gmx.fr" type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        Okay, so I compiled ffmpeg with those flags:<br>
        /configure            \<br>
            --prefix=/usr        \<br>
            --shlibdir=/usr/lib  \<br>
            --disable-static \<br>
            --enable-debug=3 \<br>
            --disable-optimizations \<br>
            --disable-stripping \<br>
            --enable-gpl         \<br>
            --enable-gnutls      \<br>
            --enable-libass      \<br>
            --enable-libfdk-aac  \<br>
            --enable-libfreetype \<br>
            --enable-libmp3lame  \<br>
            --enable-libopus     \<br>
            --enable-libtheora   \<br>
            --enable-libvorbis   \<br>
            --enable-libvpx      \<br>
            --enable-libx264     \<br>
            --enable-libx265     \<br>
            --enable-nonfree     \<br>
            --enable-shared      \<br>
            --enable-x11grab     \<br>
        And I cmake'd my program with -DCMAKE_BUILD_TYPE=Debug
        -DCMAKE_C_FLAGS=-fsanitize=address, but I still only have this
        debug trace:<br>
        <br>
        ==17320==ERROR: LeakSanitizer: detected memory leaks<br>
        <br>
        Direct leak of 664 byte(s) in 2 object(s) allocated from:<br>
            #0 0x7f5aaf43e386 in __interceptor_posix_memalign
/build/gcc-multilib/src/gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:105<br>
            #1 0x7f5aaea93b0f in av_malloc
        (/usr/lib/libavutil.so.54+0x1db0f)<br>
        <br>
        Indirect leak of 4769 byte(s) in 2 object(s) allocated from:<br>
            #0 0x7f5aaf43e386 in __interceptor_posix_memalign
/build/gcc-multilib/src/gcc-5.2.0/libsanitizer/asan/asan_malloc_linux.cc:105<br>
            #1 0x7f5aaea93b0f in av_malloc
        (/usr/lib/libavutil.so.54+0x1db0f)<br>
        <br>
        SUMMARY: AddressSanitizer: 5433 byte(s) leaked in 4
        allocation(s).<br>
        <br>
        <div class="moz-cite-prefix">The 29/08/2015 17:10, Carl Eugen
          Hoyos wrote:<br>
        </div>
        <blockquote
cite="mid:CAA2GJqUvZDMiZNmajBuTmSP=tpPWNsMx3KmgZtqMWqTQdp=95Q@mail.gmail.com"
          type="cite">
          <pre wrap=""><i>
</i>First step (that is practically always sufficient) 
is to find out where exactly (!) the memory was 
allocated: We all know that it was inside mem.c 
but the important question is what called 
av_malloc().
Either use a static binary or use 
--disable-stripping for a useful debug build.

Carl Eugen
</pre>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Libav-user mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>