After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645607 - a problem of compiling 'ext/ffmpeg/gstffmpegcodecmap.c'
a problem of compiling 'ext/ffmpeg/gstffmpegcodecmap.c'
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-libav
0.10.11
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-23 18:39 UTC by brofkims
Modified: 2011-07-11 08:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description brofkims 2011-03-23 18:39:43 UTC
1. On 64-bit Ubuntu natty(10.04 beta) gcc-4.5.2-6ubuntu5 fails to compile 'ext/ffmpeg/gstffmpegcodecmap.c' in gst-ffmpeg-0.10.11.1+gst20110318 due to a switch statement beinning at line 435.
BTW, gcc-4.4 compiles it well.
Error messages are following at the end of this report.


2. The switch statement is as follows:

    /* regardless of encode/decode, open up channels if applicable */
    /* Until decoders/encoders expose the maximum number of channels
     * they support, we whitelist them here. */
    switch (codec_id) {
      case CODEC_ID_AC3:
      case CODEC_ID_EAC3:
      case CODEC_ID_AAC:
      case CODEC_ID_DTS:
        maxchannels = 6;
        break;
      case CODEC_ID_WMAPRO:
      case CODEC_ID_TRUEHD:
        maxchannels = 8;
        break;
      default:
        break;
    }


3. This code is compiled with gcc-4.4, but is not compiled with gcc-4.5.2-6ubuntu5 due to internal compiler error.
It seems that this error begin to appear after I updated to gcc-4.5.2-6ubuntu5.

Anyhow, if I add 'maxchannels = 6' or 'maxchannels = 8' right below 'default:', both gcc-4.4 and gcc-4.5.2-6ubuntu5 comples the whole code without error.

A patch is as follows:

--- a/ext/ffmpeg/gstffmpegcodecmap.c.orig       2011-03-24 02:29:40.000000000 +0900
+++ b/ext/ffmpeg/gstffmpegcodecmap.c    2011-03-24 02:08:12.000000000 +0900
@@ -444,6 +444,7 @@
         maxchannels = 8;
         break;
       default:
+       maxchannels = 6;
         break;
     }


4.  I'm not convinced whether this is correct or not, but I am suspicious about the switch statement after reading a reference page, ie.,
http://winavr.scienceprog.com/short-introduction-to-c/program-flow-in-embedded-c.html .
 

5. Error messages are as follows:

...
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2 -I../../gst-libs -I../../gst-libs -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2 -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Wcast-align -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs -Werror -DGST_DISABLE_DEPRECATED -g -O2 -g -O2 -Wno-error -c gstffmpegcodecmap.c  -fPIC -DPIC -o .libs/libgstffmpeg_la-gstffmpegcodecmap.o
gstffmpegcodecmap.c: In function ‘gst_ffmpeg_get_palette’:
gstffmpegcodecmap.c:53:7: warning: ‘AVPaletteControl’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:2984)
gstffmpegcodecmap.c: In function ‘gst_ff_aud_caps_new’:
gstffmpegcodecmap.c:435:5: internal compiler error: in set_jump_prob, at stmt.c:2319
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.
make[4]: *** [libgstffmpeg_la-gstffmpegcodecmap.lo] error 1
make[4]: Leaving directory `/home/brofkims/build/gstreamer0.10-ffmpeg-0.10.11.1+git20110318/ext/ffmpeg'
make[3]: *** [all-recursive] error 1
make[3]: Leaving directory `/home/brofkims/build/gstreamer0.10-ffmpeg-0.10.11.1+git20110318/ext'
make[2]: *** [all-recursive] error 1
make[2]: Leaving directory `/home/brofkims/build/gstreamer0.10-ffmpeg-0.10.11.1+git20110318'
make[1]: *** [all] error 2
make[1]: Leaving directory `/home/brofkims/build/gstreamer0.10-ffmpeg-0.10.11.1+git20110318'
make: *** [debian/stamp-makefile-build] error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Comment 1 Edward Hervey 2011-07-11 08:45:06 UTC
It's a compiler bug as you mentionned.

maxchannels is already defined with a default value of 2.