<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 28, 2016 at 1:55 PM, Christopher Snowhill <span dir="ltr"><<a href="mailto:kode54@gmail.com" target="_blank">kode54@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
    <p><br>
    </p>
    <br>
    <div>On 8/28/16 12:50 AM, Paul B Mahol
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi,<br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Sun, Aug 28, 2016 at 7:16 AM,
            Christopher Snowhill <span dir="ltr"><<a href="mailto:kode54@gmail.com" target="_blank">kode54@gmail.com</a>></span> wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I've
              noticed that when using these libraries in my own
              projects, at<br>
              least in VGMStream, and with the WMA Pro codec, it is
              necessary to<br>
              perform my own pre-roll when seeking for looping, or else
              the codec<br>
              ramps the audio in from silence on every loop as it
              catches back up to a<br>
              valid state. I currently use either two seconds, or the
              beginning of the<br>
              file if it's less than two seconds prior to the intended
              seek point,<br>
              then discard sample data that is returned by the decoder.<br>
              <br>
              Is this always necessary by design? Or am I misusing the
              seeking API?<br>
              <br>
              I currently use:<br>
              <br>
              int64_t ts = target_sample * formatCtx->duration /
              total_samples;<br>
              avformat_seek_file(formatCtx, -1, ts - 1000, ts, ts,
              AVSEEK_FLAG_ANY);<br>
            </blockquote>
            <div><br>
            </div>
            <div>Do you call avcodec_flush_buffers()? <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></div></div>
    Yes, I do. Immediately after avformat_seek_file.<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra"><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>______________________________<wbr>_________________
Libav-user mailing list
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
  </span></div>

<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br><br><br><br><br>Does it make a difference if you use AV_SEEK_FLAG_BACKWARDS ?<br><br clear="all"><div dir="ltr"><br></div><br><a href="http://lives-video.com" target="_blank">http://lives-video.com</a><br><a href="https://www.openhub.net/accounts/salsaman" target="_blank">https://www.openhub.net/accounts/salsaman</a><br><br><br><br></div></div>