Mailing List archive

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

[vdr] Re: ANNOUNCE: Softdevice plugin. Use /dev/fb for output



Hi,

Roland Praml wrote:
Hello

I've uploaded a new version. This one should also compile with gcc 3.2
(I hope)

http://www.k13zoo.de/vdr/vdr-softdevice-0.0.2.tar.bz2

Comments are welcome.
I had only a short look over your code, but there came three things to my mind.

I'm not sure whether your GET_MPEG2_PTS() macro is correct, I'd write it like this:

#define GET_MPEG2_PTS(x) ( ((uint64_t)x[4]&0xFE) >>1 | \
((uint64_t)x[3]) <<7 | \
((uint64_t)x[2]&0xFE) <<14 | \
- ((uint64_t)x[1]) <<22 | \
+ ((uint64_t)x[1]) <<21 | \
((uint64_t)x[0]&0x0E) <<29 )

(x[1] contains PTS[29:21], so you need to shift it 21 bits to the left, not 22 bits)

Then you have to synchronize your local clock to the Stream clock in the playout center using the Program Clock Reference announced in the TS packet header on the PCR PID. See ITU-T H.222.0 or ISO IEC 13818-1 for a detailed explanation and implementation suggestions.

Since you usually can't adjust the clock on your sound card you need to resample the audio stream before sending it to the sound card, if the stream from air is arriving faster or slower than you can decode it you get buffer overruns or underruns otherwise.

ffplay.c is just inserting or removing dummy samples, FusionSound (part of the DirectFB project) is doing an interpolating resampling based on the pitch floating point parameter, 1.0 means no resampling. Not too hard to implement, you need probably something similiar.

Holger



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



Home | Main Index | Thread Index