[Live-devel] Time calculation in MPEG2TransportStreamFromESSource

Jeremy jeremy at electrosilk.net
Thu Oct 5 01:51:18 PDT 2006


in MPEG2TransportStreamFromESSource

00239   if (fInputBufferBytesAvailable == SIMPLE_PES_HEADER_SIZE) {
00240     // Use this presentationTime for our SCR:
00241     fSCR.highBit
00242       = ((presentationTime.tv_sec*45000 +
(presentationTime.tv_usec*9)/200)&
00243          0x80000000) != 0;
00244     fSCR.remainingBits
00245       = presentationTime.tv_sec*90000 +
(presentationTime.tv_usec*9)/100;
00246     fSCR.extension = (presentationTime.tv_usec*9)%100;

>From ISO/IEC 13818-1 2.4.2.2 extension time is the lower 9 bits of a 27Mhz
clock.

PCR_base(i) = ((system_clock_ frequency × t(i)) DIV 300) % 233 (2-2)
PCR_ext(i) = ((system_clock_ frequency × t(i)) DIV 1) % 300 (2-3)

Are the calculations on lines 245 and 246 above correct?


More information about the live-devel mailing list