Mailing List archive

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

[mpeg2] Re: Setting Audio, Video, and PCR PIDs



> The PAT and PMT are broken because of a typo:
> +       /* compute PMT */
> +       memcpy(localPMT, PMT, sizeof(PMT));
> +       localPAT[3] = 0x40 | ((cachedParams->pmt_pid >> 8) & 0x0f);
> +       localPAT[4] = cachedParams->pmt_pid & 0xff;
> should be
> +       /* compute PMT */
> +       memcpy(localPMT, PMT, sizeof(PMT));
> +       localPMT[3] = 0x40 | ((cachedParams->pmt_pid >> 8) & 0x0f);
> +       localPMT[4] = cachedParams->pmt_pid & 0xff;

Doh!

> After this change, things are working, but I still have a little
> problem: in my setup, I first run a program that opens /dev/video1, does
> some ioctl() to configure the stream, and exits; then I run a different
> program that opens /dev/video1 for reading. With your patch, this does
> not work because when the second program starts to read from /dev/video1
> saa6752hs_init() is called with params == NULL, hence it restores all
> the parameters to the default. I think that adding a
> i2c_set_clientdata(client, cachedParams);
> at the end of saa6752hs_init() fixes this problem (at least, it works
> for me, but I don't know if it is the correct thing to do -- I do not
> know the i2c stuff well).

Hmm, its supposed to be able to support that (I do something similar). When 
its called with (params!=NULL), it copies them into the cachedParams. When 
its called with (params==NULL), it just uses the cachedParams, as set by the 
previous call. Must be an annoying bug somewhere - I'll see if I can spot it.

> Unfortunately, I am currently using the mpex board for testing my
> streaming application, hence I have not much time for testing the
> patch... I hope to be able to send you an updated patch tomorrow.

Ta




Home | Main Index | Thread Index