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

Michael Niedermayer michaelni
Sun Aug 16 00:46:33 CEST 2009


On Sat, Aug 15, 2009 at 03:03:26PM +0200, Ivan Schreter wrote:
> Michael Niedermayer wrote:
>> 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?
>>>     
>>
>> no
>>
>> 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
>>  it)
>>
>>   
> Yes, I can do it this way.
>
> BUT: This makes the code more complex and marginally slower, as I have to 
> keep track of which time base was used for which timestamp, as not only 
> comparisons of timestamps are done, but also computation of minimal 
> distance with timestamps involving various streams. Especially for the 
> computation of minimal distance, I have to create a synthetic time base as 
> the product of two time bases used for two timestamps to subtract, to 
> exactly represent the distance without loss of precision.
>
> Is that OK for you?

no, our code does not work for combined (64/64) time bases
and i dont see why or where such timebases would become needed

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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/20090816/9d9eadf4/attachment.pgp>



More information about the ffmpeg-devel mailing list