[FFmpeg-devel] [PATCH]Fix PGC compilation

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Apr 18 00:26:12 CEST 2013


Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:

> The following fate tests also fail, I was unable 
> to find a workaround:
> fate-acodec-ra144
> fate-lavf-ogg

They are both related to the compilation of 
libavcodec/lpc.o, works with "-O" (but not -O2).
No warnings are shown when compiling lpc.c

Following inlined patch allows compilation 
with --disable-optimizations (which mostly 
fixes fate except the mov crash and a failure 
with smc, smc needs O0 or O1 or O2 or O3).

diff --git a/configure b/configure
index f146f7e..2aff8e2 100755
--- a/configure
+++ b/configure
@@ -2806,7 +2806,7 @@ probe_cc(){
         opt_common='-alias=ansi -Mdse -Mlre -Mpre'
         _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
         _cflags_size="-O2 -Munroll=c:1 $opt_common"
-        _cflags_noopt="-O1"
+        _cflags_noopt="-O"
         _flags_filter=pgi_flags
     elif $_cc 2>&1 | grep -q Microsoft; then
         _type=msvc


This is a workaround for the crash in movenc.c:

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8f3b1bc..8efd1cb 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1266,7 +1266,9 @@ static int mov_write_stts_tag
             if (i && duration == stts_entries[entries].duration) {
                 stts_entries[entries].count++; /* compress */
             } else {
-                entries++;
+                // Fixes a crash with Portland pgc compiler
+                int entries2 = entries + 1;
+                entries = entries2;
                 stts_entries[entries].duration = duration;
                 stts_entries[entries].count = 1;
             }


Carl Eugen



More information about the ffmpeg-devel mailing list