On 16/03/15 14:44, Martin Storsjö wrote:
Even if this is a guess, it is way better than writing a zero duration
of the last sample in a fragment (because if the duration is zero,
the first sample of the next fragment will have the same timestamp
as the last sample in the previous one).

Since we normally don't require libavformat muxer users to set
the duration field in AVPacket, we probably can't strictly require
it here either, so don't log this as a strict warning, only as info.
---
Use the duration of the second last packet as duration guess, instead of
the average duration (as in the previous version of the patch, which was
approved). Both are equally prone to be wrong, but this is more
straightforward, and hopefully more correct in some real cases.
---
  libavformat/movenc.c | 26 ++++++++++++++++++++++++++
  libavformat/movenc.h |  1 +
  2 files changed, 27 insertions(+)

The change in the heuristic seems sensible, I'd try to read the whole set again this evening.

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to