[mythtv] [mythtv-commits] Ticket #5283: startup with non unity timestretch doesnt work properly
Mark Spieth
mark at digivation.com.au
Sun May 4 05:35:49 UTC 2008
> (gdb) print org_waud
> $2 = 1536000
> (gdb) print ob
now this is interesting. someone else provided a patch for this overflow.
here is my version.
I havent seen the line(s) printed yet but it looks like it can happen. let
me know if it fixes things for you and Ill add the patch to the ticket
(without the prints of course).
mark
--- libs/libmyth/audiooutputbase.cpp (revision 17246)
+++ libs/libmyth/audiooutputbase.cpp (working copy)
@@ -1040,6 +1045,11 @@
bdiff = kAudioRingBufferSize - amount;
org_waud += amount;
+ if (org_waud >= kAudioRingBufferSize)
+ {
+ VERBOSE(VB_IMPORTANT, QString("org_waud >=
kAudioRingBufferSize %1 %2").arg(org_waud).arg(amount));
+ org_waud -= kAudioRingBufferSize;
+ }
}
}
else
@@ -1069,6 +1079,11 @@
org_waud += nSamples * audio_bytes_per_sample;
nSamplesToEnd -= nSamples;
}
+ if (org_waud >= kAudioRingBufferSize)
+ {
+ VERBOSE(VB_IMPORTANT, QString("org_waud >=
kAudioRingBufferSize %1 %2
%3").arg(org_waud).arg(nSamples).arg(audio_bytes_per_sample));
+ org_waud -= kAudioRingBufferSize;
+ }
newLen += nSamples * audio_bytes_per_sample;
len -= nSamples * audio_bytes_per_sample;
More information about the mythtv-dev
mailing list