On Sat, 29 Aug 2015, Vittorio Giovara wrote:

---
Related to

./libav/tools/ismindex.c:378:29: warning: absolute value
     function 'abs' given an argument of type 'long long' but has parameter of
     type 'int' which may cause truncation of value [-Wabsolute-value]
       if (duration > 0 && abs(duration - track->offsets[i].duration) > 3) {
                           ^
/Users/GiovaraV/src/libav/tools/ismindex.c:378:29: note: use function 'llabs'
     instead
       if (duration > 0 && abs(duration - track->offsets[i].duration) > 3) {
                           ^~~
                           llabs

Vittorio

tools/ismindex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ismindex.c b/tools/ismindex.c
index f3bfec0..71bb36b 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -375,7 +375,7 @@ static int read_tfra(struct Tracks *tracks, int 
start_index, AVIOContext *f)
    // Now try and read the actual durations from the trun sample data.
    for (i = 0; i < track->chunks; i++) {
        int64_t duration = read_moof_duration(f, track->offsets[i].offset);
-        if (duration > 0 && abs(duration - track->offsets[i].duration) > 3) {
+        if (duration > 0 && llabs(duration - track->offsets[i].duration) > 3) {
            // 3 allows for integer duration to drift a few units,
            // e.g., for 1/3 durations
            track->offsets[i].duration = duration;
--
1.9.5 (Apple Git-50.3)

Probably ok

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to