<div dir="ltr">Sorry, the reference to packet->dts is an oversight on my part in changing the code. To more closely match ffplay.c I'll update it to be:<div><br></div><div><div> if((pts = av_frame_get_best_effort_timestamp(pFrame))  == AV_NOPTS_VALUE) {</div><div>   pts = 0;</div><div> }</div></div><div><br></div><div>Later on in the code, if pts is 0, the player will simply set the pts to an external clock, which isn't the best, but it doesn't cover dropping frames, and it's what ffplay used to do. Is there a better option that is a simple fix?</div><div><br></div><div>I'm getting too much credit if people think I came up with any of this syncing code; all of it is based off of the ffplay.c source from 2007. The only work I did is trying to explain it to people. It definitely needs to be updated, but hopefully all the incorrect information is gone.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 23, 2015 at 5:31 AM, wm4 <span dir="ltr"><<a href="mailto:nfxjfg@googlemail.com" target="_blank">nfxjfg@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 23 Feb 2015 13:51:33 +0300<br>
Max Vlasov <<a href="mailto:max.vlasov@gmail.com">max.vlasov@gmail.com</a>> wrote:<br>
<br>
> Frankly, I thought that all alternatives should be considered _after_<br>
> av_frame_get_best_effort_timestamp returned  AV_NOPTS_VALUE. At least the<br>
> name suggests so. Both Stephen and ffmplay versions checks for some prior<br>
> knowledge before even trying this function. Imho, If all heuristics is<br>
> inside av_frame_get_best_effort_timestamp and better and better from<br>
> version to version, this will be "best bet" for everyone. If single frame<br>
> is not enough  then this function might require the last packet or<br>
> something like this, but moving all the complexity inside it will remove<br>
> large part of confusion<br>
<br>
</span>The heuristic in av_frame_get_best_effort_timestamp() is pretty weak,<br>
and the function doesn't exist in Libav, so you don't have to use it.<br>
It's really just a helper.<br>
<br>
For someone inexperienced, it will probably work much better than<br>
whatever he could come up, though. The FFmpeg function also falls back<br>
to DTS, and tries to resolve "strange" issues (like timestamps going<br>
backwards). So there's no reason not to suggest using it, and also<br>
there's no reason to try to fall back to DTS yourself.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div>