[FFmpeg-devel] [PATCH] lavu: make AV_TIME_BASE_Q work in C++ code

Hendrik Leppkes h.leppkes at gmail.com
Fri Jun 26 12:36:21 EEST 2020


On Fri, Jun 26, 2020 at 11:31 AM Tomas Härdin <tjoppen at acc.umu.se> wrote:
>
> ons 2020-06-24 klockan 21:22 +0200 skrev Carl Eugen Hoyos:
> > Am Mi., 24. Juni 2020 um 21:10 Uhr schrieb rcombs <rcombs at rcombs.me>:
> > > ---
> > >  libavutil/avutil.h | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/libavutil/avutil.h b/libavutil/avutil.h
> > > index 4d633156d1..c11b33f466 100644
> > > --- a/libavutil/avutil.h
> > > +++ b/libavutil/avutil.h
> > > @@ -257,7 +257,11 @@ const char *av_get_media_type_string(enum AVMediaType media_type);
> > >   * Internal time base represented as fractional value
> > >   */
> > >
> > > +#ifdef __cplusplus
> > > +#define AV_TIME_BASE_Q          AVRational{1, AV_TIME_BASE}
> > > +#else
> > >  #define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
> > > +#endif
> >
> > The problem with this patch is that it gives C++ users of the libraries
> > the feeling that we would care about them and that we would indeed
> > fix issues.
> > Given that the contrary is true (at least in the past) and that we do
> > not do any specific C++ testing, I believe it is better to let users
> > work around this issue (from their point of you).
>
> Maybe we should put in a #warning to that effect? Inside an #ifdef
> __cplusplus
>

Now that would just be annoying. 99% of the headers work just fine in
C++, spewing a warning at us for using them would not serve anything.

- Hendrik


More information about the ffmpeg-devel mailing list