<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 8/28/16 9:56 AM, salsaman wrote:<br>
    </div>
    <blockquote
cite="mid:CAA74=eXs_c6NrzwXx3V8ecg3ungXeCeyXRJ8_ZzbkHhVgCzHmw@mail.gmail.com"
      type="cite">
      <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
                moz-do-not-send="true" 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 moz-do-not-send="true"
                                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 moz-do-not-send="true" href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a>
<a moz-do-not-send="true" href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a>
</pre>
    </blockquote>
    

  </span></div>


______________________________<wbr>_________________

Libav-user mailing list

<a moz-do-not-send="true" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>

<a moz-do-not-send="true" href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a>


</blockquote></div>




Does it make a difference if you use AV_SEEK_FLAG_BACKWARDS ?

</div></div></blockquote>
No.

<blockquote cite="mid:CAA74=eXs_c6NrzwXx3V8ecg3ungXeCeyXRJ8_ZzbkHhVgCzHmw@mail.gmail.com" type="cite"><div dir="ltr"><div class="gmail_extra"><div dir="ltr">
</div>
<a moz-do-not-send="true" href="http://lives-video.com" target="_blank">http://lives-video.com</a>
<a moz-do-not-send="true" href="https://www.openhub.net/accounts/salsaman" target="_blank">https://www.openhub.net/accounts/salsaman</a>



</div></div>


<fieldset class="mimeAttachmentHeader"></fieldset>
<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>
</body></html>