From ce35c076392eb9f372dd3e5afd4cf18e8b411237 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Thu, 24 Oct 2024 18:25:36 -0300 Subject: [PATCH] mpg123audiodec: Fix dependence on off_t breaking Meson wrap-based builds Using the mpg123_*_64 functions requires API level 48 i.e. mpg123 >= 1.32. The mpg123_*64 functions are available before then, but still depend on off_t (and as such introduce the bug in builds against distro provided mpg123). See https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1568#note_2624024 Part-of: --- subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.c | 5 +++++ subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.c b/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.c index 44632204db..e025d6895a 100644 --- a/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.c +++ b/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.c @@ -448,8 +448,13 @@ gst_mpg123_audio_dec_handle_frame (GstAudioDecoder * dec, /* Try to decode a frame */ decoded_bytes = NULL; num_decoded_bytes = 0; +#if MPG123_API_VERSION >= 48 + decode_error = mpg123_decode_frame64 (mpg123_decoder->handle, + &mpg123_decoder->frame_offset, &decoded_bytes, &num_decoded_bytes); +#else decode_error = mpg123_decode_frame (mpg123_decoder->handle, &mpg123_decoder->frame_offset, &decoded_bytes, &num_decoded_bytes); +#endif if (G_LIKELY (decoded_bytes != NULL)) { gst_mpg123_audio_dec_pop_oldest_clip_info (mpg123_decoder, &clip_start, diff --git a/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.h b/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.h index ed1d13517e..770f62525e 100644 --- a/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.h +++ b/subprojects/gst-plugins-good/ext/mpg123/gstmpg123audiodec.h @@ -40,7 +40,11 @@ struct _GstMpg123AudioDec GstAudioInfo next_audioinfo; gboolean has_next_audioinfo; +#if MPG123_API_VERSION >= 48 + gint64 frame_offset; +#else off_t frame_offset; +#endif GstVecDeque *audio_clip_info_queue; };