GNOME Bugzilla – Bug 779333
tsdemux: Probably broken code, compiler warning with gcc 7
Last modified: 2017-02-28 08:39:02 UTC
pesparse.c: In function ‘mpegts_parse_pes_header’: pesparse.c:324:46: error: ‘<<’ in boolean context, did you mean ‘<’ ? [-Werror=int-in-bool-context] (GST_READ_UINT16_BE (data) & 0x1fff) << (val8 & 0x20) ? 10 : 7; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ I'm not sure what this code is trying to do, but it seems to make no sense in any way. It would either shift by 0 or by 0x20 there. If it shifts by 0x20, it will be 0 and evaluate to 7... otherwise it will be 7 if those 2 bytes are 0, or 10 otherwise. This does not seem to make any sense and I can't find the spec currently :)
Created attachment 346889 [details] [review] mpegtsdemux: Fix wrong usage of '<<' operator Detected by GCC 7. Add comments for clarity
commit fcf87ef2bf1967512e9e44f46f6a20eb542b6cc4 Author: Edward Hervey <edward@centricular.com> Date: Tue Feb 28 09:26:25 2017 +0100 mpegtsdemux: Fix wrong usage of '<<' operator Detected by GCC 7. Add comments for clarity https://bugzilla.gnome.org/show_bug.cgi?id=779333