<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:0 0 0 .8ex;border-left:1px #ccc solid;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()? </div></div><br></div></div>