[FFmpeg-devel] Collection of patches

Thorsten Jordan tjordan
Thu Apr 24 08:51:07 CEST 2008


Michael Niedermayer schrieb:
> On Wed, Apr 23, 2008 at 01:55:13PM +0200, Thorsten Jordan wrote:
>> Michael Niedermayer schrieb:
>>> On Wed, Apr 23, 2008 at 09:15:40AM +0200, Thorsten Jordan wrote:
>>>> Michael Niedermayer schrieb:
>>>>> On Tue, Apr 22, 2008 at 12:36:02PM +0200, Thorsten Jordan wrote:
>>>>> [...]
>> My patch checks if the first byte of the buffer is 0x47 (always true for
>> ts) and if not to advance 4 bytes (it assumes mts then), and decode the
>> PCR from there.
> 
> Nonsense, the problem has nothing to do with mts
> This is about packets not begining exactly at the file start
> the same will happen with any random ts file that has been cut by dd.
> Our naive seeking code assumes packets do start exactly at the file
> start, the idea to fix the case where its exactly 4 bytes off in a hack like
> you do is insane. ... And the idea to write a seperate demuxer for that is
> even more insane.
> 
> Proper fix below (which i will apply in 24h unless mans objects)
Ah I missed that you analyze the raw packet size earlier and read that
size, which is some kind of solution to the mts reading. Last time I
read the mpegts code it seemed to me that the demuxer always looks for a
0x47 to find the next packet start and with that code also skips the 4
bytes of the mts counter. That is why i proposed a mts special handling,
but it was already there.

I suppose with your patch there is also no problem when the counter
itself would contain 0x47 bytes (may happen), because the raw packet
size is already known?

Thanks for the fix!

-- 
Regards, Thorsten




More information about the ffmpeg-devel mailing list