[mythtv] [PATCH] DVB fixes

Kenneth Aafløy ke-aa at frisurf.no
Sat Dec 20 21:32:14 EST 2003


Hi,

> Correction, the transform.c and .h patches are related to 
> channel changing and adjusting the header accordingly. It 
> shouldn't affect multiple cards because each card will run 
> it's own channel thread.

What is important is that it's run with it's own context,
that's what the ipack's are for.

>>>And my recordings start with a 1e0 start code, which is video,
>>>and probably not the start of a keyframe, since the output is
>>>garbled at the start.
>>
>>It's not possible to get a 1e0 with the new code. Are you 
>>sure the patch applied clean to all files? I'll make sure I 
>>sent correct patch. The .nuv file should start with a 00 00 01 BA.
>> What PIDs are you using? v,a anything else?

Just one video + audio pid for each service id. And the patch
applied cleanly.

>>>> You can try to enable the wait_for_seqstart, however, the 
>>>> code in dvbrecorder.cpp has to be revised in order for the 
>>>> "wait_for_seqstart" to work properly.
>>>> The issue with the current code is that it drops the Program 
>>>> Stream Header. The current decoder in mythtv works without 
>>>> the start code, but a number of other applications don't like 
>>>> a PS file without this, because they identify the file as a 
>>>> PES and depending on the application do bad things...
>>>
>>>Strange tho, since my recording does not start with that header.
>>>
>>>What is the startcode of that header (I'll test waiting for that)?
>>>
>>The header doesn't come in the TS. It has to be generated. 
>>It's generated in ctools.c in libdvbdev. I had a couple of other
>>people testing this before I send the patch and in 100% of the tests
>>the file start with the proper header 00 00 01 BA.
>>I've been testing it for one week now.

But none of those had a cam attached, right?

The problem is that the cam is sent a program map table, which I have
to wait for in dvbcam. This will then skip some content in the stream,
because the cam won't let data through untill it knows what to decode,
and has verified the card ws stream content.

I'm also pretty sure that all info in the PS is contained in the TS
packets, and not generated by libdvbdev. Because TS is merely a wrapper
for the PS, which just needs unpacking.

>>>> The transform.c should wait for the start code, it works for 
>>>> all the tests I've done using Satellite. DVB-T should be the same.
>>>
>>>Hmm, it didn't do that when I wrote it, did you put that feature in
>>>with your patch (which was the reason for putting in the wait stuff)?
>>
>>In order to generate the header 00 00 01 BA, it's necessary to have
>>the video and audio stream info. This is done automatic in 
>>transform.c. The code that uses the wait_for_seqstart removes the
>>header by accident. The patch in transform.c is to fix the problem
>>with multiple cards.

Nothing audio/video related is stored in 1ba (pack_start), it's stored
in a program map with startcode 1bc (look at libavformat/mpeg.c). It's
merely an indicator of the start of a group of packets, iirc.

>>I'm very puzzled with your results. If the wait_for_seqstart 
>>is false, you have one 'v' pid and one 'a' pid, you should never
>>get a 00 00 01 E0 as the first code 4 bytes in the .nuv file.
>>This is wrong for a PS file.

Have to agree with you that it's wrong.

Kenneth



More information about the mythtv-dev mailing list