El 13/05/16 a las 11:25, Anton Shekhovtsov escribió:

Thanks for reply.
I decided I can loop through index_entries and if there is no 'keyframes' apply AVSEEK_FLAG_ANY. When it comes to seeking I do not select id, I just have it. The code deals with single stream (audio), other streams are AVDISCARD_ALL.
For pos something like this, but why do you ask?
int64_t pos = (destination_sample-discard_samples) * time_base.den / time_base.num;
I ask because the docs say:

 * @param timestamp Timestamp in AVStream.time_base units

And you are multiplying the denominator / numerator when in fact it should be the opposite. With that, you should be able to multiply, say 1 sec, and get the right place in pos.

--
Gonzalo Garramuño
[email protected]

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to