summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGünter Merz <lotan_rm@hotmail.com>2010-07-18 14:47:16 +0000
committerGünter Merz <lotan_rm@hotmail.com>2010-07-18 14:47:16 +0000
commit1c9cf7069230ea1016879161d5530fbbd5721d43 (patch)
treead5657dc785158f886725c33763d8d267b21ccba /lib
parente9c4a618fbc47dae2cdd82d4d09ade8ec020bfe1 (diff)
downloadxine-lib-1c9cf7069230ea1016879161d5530fbbd5721d43.tar.gz
xine-lib-1c9cf7069230ea1016879161d5530fbbd5721d43.tar.bz2
Fix metronome not getting audio PTS
The xine libmad adaptor seemed not to forward the pts to the metronome: It buffers the MPEG audio packets until a threshold is reached (MAD_MIN_SIZE: 2889 bytes) and then has libmad decode the packets which is send to audio out. The pts of the last audio packet is forwarded on to metronome which can then sync video with audio. For the channel4 channels MPEG audio packets have a size of 576 bytes which means it takes five packets to fill the buffer enough for processing. In the stream every fifth audio packet contains a pts. The result of this is: If after a seek, the last audio packet is the one with the pts, video and audio are in sync. If the pts is in any of the four previous ones no pts will reach metronome and video and audio will never be synced before a new seek and even then there's a one in five chance that video and audio are not synced. Other channels did not show this behaviour because e.g. BBC One has an audio packet size of about 750 bytes and send a pts every fifth packet as well. This means that not every pts from the stream gets through to metronome but some do. This also means that syncing after a seek is probably not as quick as it could be but it will sync. My workaround to this problem is to start decoding not only when a the buffer has reached a threshold but also when a pts != 0 arrives. This does mean however that the buffer isn't always filled to the theshold and decoding might not perform as well as it could. --HG-- extra : transplant_source : %EC%90%EB%AA%8A%C7%BD%A4%B7%EE%F5%E9%E8SY%89S%9D0s
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions