[mythtv] [mythtv-commits] Ticket #1356: DTVRecorder::FindKeyframes in 0.19 causes video gltiches in firewire recordings

Daniel Kristjansson danielk at cuymedia.net
Sun Mar 5 00:20:45 UTC 2006


On Sat, 2006-03-04 at 14:15 -0800, Jim Westfall wrote:
> can anyone explain this part of ::FindKeyframes?
> 
>     // if packet contains start of PES packet, start
>     // looking for first byte of MPEG start code (3 bytes 0 0 1)
>     // otherwise, pick up search where we left off.
>     const bool payloadStart = tspacket->PayloadStart();
>     _header_pos = (payloadStart) ? 0 : _header_pos;
> 
> If the packet doesnt contain the start of a PES packet, which is what 
> we are looking for, why do we process the packet?  
> 
> I would think we could short circuit on (!payloadStart && !_header_pos).

Yeah, I used to think so too and had that short circuit in the
code for a while, but sometimes the headers we are looking for
are not in the first TS packet containing the PES packet. This
happens especially with DVB-S, because they often insert a lot
of non-video data into the video packets, but can happen with any
stream encoded at the broadcast end.

When I get around to fixing #799 we should be able to short
circuit the scan at a safe point in the pes packet. I've also
avoided  optimizing the FindKeyFrames function because I knew
we needed to fix #799 first.

-- Daniel



More information about the mythtv-dev mailing list