summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/combined/ffmpeg/demux_avformat.c2
-rw-r--r--src/demuxers/demux_matroska.c2
-rw-r--r--src/demuxers/demux_yuv_frames.c2
-rw-r--r--src/xine-engine/audio_out.c10
4 files changed, 8 insertions, 8 deletions
diff --git a/src/combined/ffmpeg/demux_avformat.c b/src/combined/ffmpeg/demux_avformat.c
index c929a0390..d0bd8175c 100644
--- a/src/combined/ffmpeg/demux_avformat.c
+++ b/src/combined/ffmpeg/demux_avformat.c
@@ -271,7 +271,7 @@ typedef struct {
static void check_newpts(avformat_demux_plugin_t *this, int64_t pts) {
int64_t diff = this->last_pts - pts;
- if (this->seek_flag || this->send_newpts || (this->last_pts && abs(diff) > WRAP_THRESHOLD)) {
+ if (this->seek_flag || this->send_newpts || (this->last_pts && llabs(diff) > WRAP_THRESHOLD)) {
_x_demux_control_newpts(this->stream, pts, this->seek_flag);
this->send_newpts = 0;
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index d586b1ac9..ce81aa843 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -62,7 +62,7 @@ static void check_newpts (demux_matroska_t *this, int64_t pts,
diff = pts - track->last_pts;
- if (pts && (this->send_newpts || (track->last_pts && abs(diff)>WRAP_THRESHOLD)) ) {
+ if (pts && (this->send_newpts || (track->last_pts && llabs(diff)>WRAP_THRESHOLD)) ) {
int i;
lprintf ("sending newpts %" PRId64 ", diff %" PRId64 ", track %d\n", pts, diff, track->track_num);
diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c
index 78d5e079b..26ac5d65b 100644
--- a/src/demuxers/demux_yuv_frames.c
+++ b/src/demuxers/demux_yuv_frames.c
@@ -76,7 +76,7 @@ static int switch_buf(demux_yuv_frames_t *this , buf_element_t *buf){
if (this->seek_flag) {
this->seek_flag = 0;
_x_demux_control_newpts(this->stream, buf->pts, BUF_FLAG_SEEK);
- } else if (abs(this->last_pts - buf->pts) > WRAP_THRESHOLD) {
+ } else if (llabs(this->last_pts - buf->pts) > WRAP_THRESHOLD) {
_x_demux_control_newpts(this->stream, buf->pts, 0);
}
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index afead93f9..7369df433 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -887,7 +887,7 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
double duration;
int i;
- if (abs(gap) > AO_MAX_GAP) {
+ if (llabs(gap) > AO_MAX_GAP) {
/* drop buffers or insert 0-frames in audio out loop */
info->valid = 0;
return -1;
@@ -912,7 +912,7 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
/* gap too big? Change sample rate so that gap converges towards 0. */
- if (abs(avg_gap) > RESAMPLE_REDUCE_GAP_THRESHOLD && !info->reduce_gap) {
+ if (llabs(avg_gap) > RESAMPLE_REDUCE_GAP_THRESHOLD && !info->reduce_gap) {
info->reduce_gap = 1;
this->resample_sync_factor = (avg_gap < 0) ? 0.995 : 1.005;
@@ -920,7 +920,7 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
"sample rate adjusted to reduce gap: gap=%" PRId64 "\n", avg_gap);
return 0;
- } else if (info->reduce_gap && abs(avg_gap) < 50) {
+ } else if (info->reduce_gap && llabs(avg_gap) < 50) {
info->reduce_gap = 0;
info->valid = 0;
llprintf (LOG_RESAMPLE_SYNC, "gap successfully reduced\n");
@@ -929,7 +929,7 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
} else if (info->reduce_gap) {
/* re-check, because the gap might suddenly change its sign,
* also slow down, when getting close to zero (-300<gap<300) */
- if (abs(avg_gap) > 300)
+ if (llabs(avg_gap) > 300)
this->resample_sync_factor = (avg_gap < 0) ? 0.995 : 1.005;
else
this->resample_sync_factor = (avg_gap < 0) ? 0.998 : 1.002;
@@ -1209,7 +1209,7 @@ static void *ao_loop (void *this_gen) {
* feedback them into metronom's vpts_offset (when using
* metronom feedback for A/V sync)
*/
- } else if ( abs(gap) < AO_MAX_GAP && abs(gap) > this->gap_tolerance &&
+ } else if ( llabs(gap) < AO_MAX_GAP && abs(gap) > this->gap_tolerance &&
cur_time > (last_sync_time + SYNC_TIME_INVERVAL) &&
bufs_since_sync >= SYNC_BUF_INTERVAL &&
!this->resample_sync_method ) {