In the following function fVideoSourceCounter should be fAudioSourceCounter 00088 void MPEG2TransportStreamFromESSource 00089 ::addNewAudioSource(FramedSource* inputSource, int mpegVersion) { 00090 u_int8_t streamId = 0xC0 | (fVideoSourceCounter++&0x0F); 00091 addNewInputSource(inputSource, streamId, mpegVersion); 00092 }