Skip to content

Commit

Permalink
Replace fmin and fmax with MIN and MAX and avoid including <math.h>
Browse files Browse the repository at this point in the history
  • Loading branch information
touatily committed Mar 6, 2024
1 parent 80163b6 commit a0b768f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/media_tools/route_dmx.c
Expand Up @@ -23,7 +23,6 @@
*
*/

#include <math.h>
#include <gpac/route.h>

#if !defined(GPAC_DISABLE_ROUTE)
Expand Down Expand Up @@ -960,8 +959,8 @@ static GF_Err gf_route_service_gather_object(GF_ROUTEDmx *routedmx, GF_ROUTEServ
} else {
int old_size = obj->frags[start_frag].size;

int end = fmax(start_offset+size, obj->frags[end_frag-1].offset+obj->frags[end_frag-1].size);
obj->frags[start_frag].offset = fmin(obj->frags[start_frag].offset, start_offset);
int end = MAX(start_offset+size, obj->frags[end_frag-1].offset+obj->frags[end_frag-1].size);
obj->frags[start_frag].offset = MIN(obj->frags[start_frag].offset, start_offset);
obj->frags[start_frag].size = end - obj->frags[start_frag].offset;

if(end_frag == start_frag + 1) {
Expand Down

0 comments on commit a0b768f

Please sign in to comment.