Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linuxtv-softmpeg] Re: MPEG header sizes



Hello Colin,

On 03/30/04 09:35, Colin Paton wrote:
Sorry for not sending you the buffer check patch - I haven't yet connected
my machine back up to the network. I was busy last night trying to get it
working, as it still crashes :-(
No problem, I don't mind if you fix the problems by yourself... ;-)

I put some checks in softmpeg_handle_pes_data in softmpeg.c, as the PES
header length is read straight from the data stream (as per the spec.)
However, I found that during errored streams this length could be garbage.
In particular, it was possible for the header stream to be *longer* than the
PES packet - this caused a crash also.
*mumble* Yes, I know.

The code is not very graceful. But because of the fact that I couldn't take any code from pure GPL projects, I had to write these quick-and-dirty stuff once again, although intelligent people have probably written very good demuxers already.

There need to be tons of size checks added to the code.

I noticed empirically that the PES header length always seemed to be 14
bytes or 19 bytes - but looking at the MPEG spec it appears that it can be a
whole number of lengths depending on options. For now, I've chosen to ignore
the packet if it is smaller than 14 or larger than 19 bytes, but I'm not
sure if this is an entirely correct way of doing things.
Ok, I'll have to look this up in the specs, too.

However, I still get a crash which I cannot track down. Fortunately I
managed to record the stream that causes this, so I now have a VDR file
which I can play back and causes the decoder to crash. It's 200Mb so is too
large to put on the web (at least with my web space) so I'll see if I can
try and isolate the part of the file that causes the crash.
I probably can arrange a one-time account on our ftp server. Do you have a decent upstream for uploading?

Is it possible to split the VDR recording?

I *suspect* still that the stack is corrupted - for example, if I comment
out the call to the video decoder 'd->decode' in video.c I get no crash. If
I leave this call in, but make the first line of the decoder return then I
get a crash. This makes me suspect that it's either something in the audio
decoding part, or in the video buffering part, that is crashing, yet audio
plays OK (well, subject to loads of errors - lots of pops and squeaks).

Has anyone got any suggestions to help track this down?
Either turn all debugging options on and follow every call to the demuxing functions or we need to go through the code bit by bit and add sanity checks at all places where needed.

Thanks,
Colin
CU
Michael.


--
Info: To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linuxtv-softmpeg" as subject.



Home | Main Index | Thread Index