Opened 6 months ago

Last modified 3 months ago

#2423 open defect

Undeclared constant 'M_PI' in xvid_vbr macro 'DEG2RAD'

Reported by: bug Owned by: beastd
Priority: normal Component: build system
Version: HEAD Severity: blocker
Keywords: xvid_vbr maths constants Cc: LigH
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description (last modified by bug)

Summary of the bug:
Undeclared constant 'M_PI' in xvid_vbr macro 'DEG2RAD'

How to reproduce:
Compiling mencoder in media-autobuild suite (MSYS2/MinGW, GCC 13.2)

xvid_vbr.c: In function 'vbr_init_2pass2':
xvid_vbr.c:44:18: error: 'M_PI' undeclared (first use in this function)
   44 | #define DEG2RAD (M_PI / 180.0)
      |                  ^~~~
xvid_vbr.c:887:53: note: in expansion of macro 'DEG2RAD'
  887 |                                         (1.0 +  sin(DEG2RAD * (state->average_frame * 90.0 / state->alt_curve_low_diff)));
      |                                                     ^~~~~~~
xvid_vbr.c:44:18: note: each undeclared identifier is reported only once for each function it appears in
   44 | #define DEG2RAD (M_PI / 180.0)
      |                  ^~~~
xvid_vbr.c:887:53: note: in expansion of macro 'DEG2RAD'
  887 |                                         (1.0 +  sin(DEG2RAD * (state->average_frame * 90.0 / state->alt_curve_low_diff)));
      |                                                     ^~~~~~~
xvid_vbr.c: In function 'vbr_getquant_2pass2':
xvid_vbr.c:44:18: error: 'M_PI' undeclared (first use in this function)
   44 | #define DEG2RAD (M_PI / 180.0)
      |                  ^~~~
xvid_vbr.c:1250:84: note: in expansion of macro 'DEG2RAD'
 1250 |                                                                                sin(DEG2RAD * ((dbytes - state->average_frame) * 90.0 / state->alt_curve_high_diff)));
      |                                                                                    ^~~~~~~

Attachments (1)

0001-xvid_vbr-Include-lavu-mathematics.h-to-make-sure-the.patch (610 bytes ) - added by beastd 5 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 by bug, 6 months ago

Description: modified (diff)

comment:2 by beastd, 5 months ago

Status: newopen

Thanks for the report!

Do you know what changed so this is a problem now?

For me it always worked so far. Unfortunately M_PI seems to be in not even a single C standard so far...

Does attachment:0001-xvid_vbr-Include-lavu-mathematics.h-to-make-sure-the.patch fix the problem for your builds?

comment:3 by LigH, 4 months ago

The reason might be GCC 14.1 with stricter default warnings-as-errors than 13.2 before.

Patch applied; error moved to libaf/af_equalizer.c

comment:4 by LigH, 4 months ago

Cc: LigH added

comment:5 by beastd, 4 months ago

Ah OK that might be related. GCC 14 will definitely need some more work...

I have put a patch on the mplayer development mailing list:

https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2024-April/074173.html

But it is not really the way to fix those problems, but if you need GCC 14 build, it should probably work in practice.

comment:6 by LigH, 4 months ago

I may mention it in the M-AB-S issues, but will probably wait for your official commit and the closing of this ticket (there is only little need for mplayer/mencoder in these days). For now, thank you for your efforts.

comment:7 by LigH, 3 months ago

So that was in April ... the mailing list contains a few steps of success but no final result, AFAICS.

Version 0, edited 3 months ago by LigH (next)
Note: See TracTickets for help on using tickets.