[FFmpeg-devel] [PATCH] Add documentation that seeking is done by DTS and not PTS

Robert Krüger krueger at lesspain.de
Wed May 2 10:49:25 CEST 2012


On Mon, Apr 30, 2012 at 3:53 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Apr 13, 2012 at 06:57:07PM +0200, Michael Niedermayer wrote:
>> On Fri, Apr 13, 2012 at 10:49:44AM -0600, Michael Bradshaw wrote:
>> > On Thu, Apr 12, 2012 at 9:48 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
>> >
>> > > On Thu, Apr 12, 2012 at 07:42:42AM -0600, Michael Bradshaw wrote:
>> > > > On Thu, Apr 12, 2012 at 6:40 AM, Michael Niedermayer <michaelni at gmx.at
>> > > >wrote:
>> > > >
>> > > > > On Wed, Apr 11, 2012 at 10:22:59PM -0600, Michael Bradshaw wrote:
>> > > > > > Signed-off-by: Michael Bradshaw <mbradshaw at sorensonmedia.com>
>> > > > > > ---
>> > > > > >  libavformat/avformat.h |    5 +++++
>> > > > > >  1 files changed, 5 insertions(+), 0 deletions(-)
>> > > > > >
>> > > > > > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>> > > > > > index 5a11fdc..e4ec415 100644
>> > > > > > --- a/libavformat/avformat.h
>> > > > > > +++ b/libavformat/avformat.h
>> > > > > > @@ -1456,6 +1456,9 @@ int av_read_frame(AVFormatContext *s, AVPacket
>> > > > > *pkt);
>> > > > > >  /**
>> > > > > >   * Seek to the keyframe at timestamp.
>> > > > > >   * 'timestamp' in 'stream_index'.
>> > > > > > + *
>> > > > > > + * Note that seeking is done by DTS and not by PTS.
>> > > > >
>> > > > > this is not true for all demuxers, nut should be seeking to pts for
>> > > > > example.
>> > > > >
>> > > >
>> > > > Oh great, so this is even more confusing than I thought ;). Is there any
>> > > > way of knowing if a demuxer seeks by DTS or by PTS? Should I change the
>> > > > patch to say something along the lines of:
>> > > >
>> > > > "Note that some demuxers seek by DTS and some seek by PTS."?
>> > >
>> > > we could add a flag that specifies if a demuxer is able to seek by pts.
>> >
>> >
>> > Would this be part AVInputFormat.flags? I would be in favor of having a
>> > flag that allows the user to know if seeking is done by PTS or DTS.
>>
>> yes, that was the idea
>
> flag added locally, will be in my next git push
> feel free to add the flag to demuxers to which it applied
>
> Thanks

great! just out of curiosity and because it's related to my question
regarding index entry timestamp semantics a few months ago: is there
any use case where it makes sense from an API user perspective to seek
by DTS or is this something that just happened because it is easier
from the implementation point of view for some containers? I'm not
trying to criticize anything. I'm merely trying to understand because
I have not come across a reason to seek by DTS.

hope this is not OT for this thread.


More information about the ffmpeg-devel mailing list