Permalink
Browse files

Remove the use of abs(long long) as it freaks out ARM compilers

Rather than using qAbs or llabs, it's simple enough in the specific situations
to just avoid using abs() altogether.

Fixes #10915
  • Loading branch information...
Beirdo committed Jul 17, 2012
1 parent 8211f9d commit 13163358dd54687628233ce4285f09435c0066c2
Showing with 8 additions and 3 deletions.
  1. +8 −3 mythtv/programs/mythtranscode/transcode.cpp
@@ -493,11 +493,15 @@ class Cutter
bool InhibitUseAudioFrames(int64_t frames, long *totalAudio)
{
+ int64_t delta = audioFramesToCut - frames;
+ if (delta < 0)
+ delta = -delta;
+
if (audioFramesToCut == 0)
{
return false;
}
- else if (abs(audioFramesToCut - frames) < audioFramesToCut)
+ else if (delta < audioFramesToCut)
{
// Drop the packet containing these frames if doing
// so gets us closer to zero left to drop
@@ -1612,11 +1616,12 @@ int Transcode::TranscodeFile(const QString &inputname,
int vidTime = (int)(curFrameNum * vidFrameTime + 0.5);
int viddelta = frame.timecode - vidTime;
int delta = viddelta - auddelta;
- if (abs(delta) < 500 && abs(delta) >= vidFrameTime)
+ int absdelta = delta < 0 ? -delta : delta;
+ if (absdelta < 500 && absdelta >= vidFrameTime)
{
QString msg = QString("Audio is %1ms %2 video at # %3: "
"auddelta=%4, viddelta=%5")
- .arg(abs(delta))
+ .arg(absdelta)
.arg(((delta > 0) ? "ahead of" : "behind"))
.arg((int)curFrameNum)
.arg(auddelta)

0 comments on commit 1316335

Please sign in to comment.