[FFmpeg-devel] [PATCH] First shot at AVCHD seeking via new seeking API

Michael Niedermayer michaelni
Tue Aug 11 18:55:30 CEST 2009

On Sun, Aug 09, 2009 at 09:48:18AM +0200, Ivan Schreter wrote:
> Hi Michael,
> Michael Niedermayer wrote:
>> [...]
>> ive not checked to the code so i possibly miss somethng but timestamp
>> code must be exact, that is for example if you compare 2 timestamps
>> from 2 streams these must not be rescaled to AV_TIME_BASE but rather
>> the compare must be done exactly
> But what if the streams have different st->time_base? Then it's impossible 
> to compare directly, but it has to be rescaled to a common time base.
> Since normally streams have siginificantly less resolution than 
> AV_TIME_BASE, comparison with values rescaled to AV_TIME_BASE is as exact 
> as with timestamps directly, but it takes into account the possibility of 
> different time bases for each stream. Right?


ill copy & paste from the nut spec on how to compare timestamps exactly
for more elaborate explanation see the spec yourself

    if (convert_ts(a, a_timebase, b_timebase) < b) return -1;
    if (convert_ts(b, b_timebase, a_timebase) < a) return  1;
    return 0;

(convert_ts here must round down and be exact, the nut spec also
 explains how to do this in C but we already have a fitting function for


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090811/4c71bc03/attachment.pgp>

More information about the ffmpeg-devel mailing list