[mythtv] AddAudioData passed incorrect timecode causes stutter after skip

mythtv mythtv at modified.cc
Fri Aug 15 22:26:33 UTC 2008

Hi DEV's,

I'm currently running trunk Revision: 18108 (although I've had this 
problem since using mythtv for HD content) and am experiencing audio and 
video stutter on a certain HD channel.  I am in a PAL area (Australia).

When a skip is performed the timecode passed to 
NuppelVideoPlayer::AddAudioData by avformatdecoder is reset to 0 and 
starts counting up.  This is caused by pkt->pts resetting to 0 and 
counting up.  This causes A/V Divergence to report massively high 
values.  This stutter continues until the timecode is "magically" 
returned to normal values.  The behavior is only bad on one HD channel 
(running 1440x1080) and cannot be replicated on another HD channel 
(running 1280x720).  It can be replicated on a SD channel, but only 
occasionally occurs and corrects itself so quickly that it is very 
difficult to see.

The following code at the end of NuppelVideoPlayer::WarpFactor works 
around the problem at the expense of extended lip sync issues.

     if ((divergence > DIVERGELIMIT) || (divergence < -DIVERGELIMIT)) {
         divergence = MAXDIVERGE;
     return divergence;

At this point I've run out of talent and cannot determine:

a. if pkt->pts is reporting 0 correctly (e.g. if it only gets set to an 
absolute value on a keyframe) ; or
b. if the code that determines this value has a bug (or indeed which bit 
of the code sets the value...).

If someone can point me in the right direction it would be greatly 


HD Prime
2008-08-16 07:39:02.569 A/V timecodes audio 11194847 video 11194987 
frameinterval 40000 avdel 140 avg 35000 tcoffset 0
2008-08-16 07:39:02.927 A/V timecodes audio 130 video 11225107 
frameinterval 40000 avdel 11224977 avg 35000 tcoffset 0
[snip 112 lines]
2008-08-16 07:39:07.420 A/V timecodes audio 4621 video 11229547 
frameinterval 40000 avdel 11224926 avg -414994222 tcoffset 0
2008-08-16 07:39:07.460 A/V timecodes audio 11229338 video 11229587 
frameinterval 40000 avdel 249 avg -414993972 tcoffset 0

[no errors]

2008-08-16 07:40:59.139 A/V timecodes audio 2580086 video 2580304 
frameinterval 40000 avdel 218 avg 54250 tcoffset 0
2008-08-16 07:40:59.339 A/V timecodes audio 10 video 3180464 
frameinterval 40000 avdel 3180454 avg 54500 tcoffset 0
[snip 3 lines]
2008-08-16 07:40:59.498 A/V timecodes audio 170 video 3180624 
frameinterval 40000 avdel 3180454 avg -278628074 tcoffset 0
2008-08-16 07:40:59.538 A/V timecodes audio 3180325 video 3180664 
frameinterval 40000 avdel 339 avg -278628324 tcoffset 0

More information about the mythtv-dev mailing list