<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-08-28 8:16 GMT+03:00 Christopher Snowhill <span dir="ltr"><<a href="mailto:kode54@gmail.com" target="_blank">kode54@gmail.com</a>></span>:<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>
<br>
<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></div><div class="gmail_extra">I noticed similar behavior with AAC decoder, work around by dropping 1024 decoded samples. (1024 is arbitrary number that worked for me)<br></div></div>