Opened 11 years ago

Closed 11 years ago

#40605 closed defect (fixed)

mpd 0.17.5 fails to build due to ffmpeg AVCODEC_MAX_AUDIO_FRAME_SIZE missing

Reported by: max-arnold (Max Arnold) Owned by: rmstonecipher@…
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc:
Port: mpd

Description

mpd 0.17.5 fails to build with ffmpeg 2.0.1_1:

:info:build mv -f src/decoder/.deps/libdecoder_plugins_a-dsdlib.Tpo src/decoder/.deps/libdecoder_plugins_a-dsdlib.Po
:info:build mv -f src/decoder/.deps/libdecoder_plugins_a-dsf_decoder_plugin.Tpo src/decoder/.deps/libdecoder_plugins_a-dsf_decoder_plugin.Po
:info:build depbase=`echo src/filter/chain_filter_plugin.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:build     /usr/bin/clang -DHAVE_CONFIG_H -I.  -DNDEBUG -I./src -D_REENTRANT -isystem /opt/local/include/glib-2.0 -isystem /opt/local/lib/glib-2.0/include -isystem /opt/local/include -DSYSTEM_CONFIG_FILE_LOCATION='"/opt/local/etc/mpd.conf"' -I/opt/local/include  -pipe -Os -I/opt/local/include -arch x86_64 -Wall -Wextra -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wwrite-strings -pedantic -MT src/filter/chain_filter_plugin.o -MD -MP -MF $depbase.Tpo -c -o src/filter/chain_filter_plugin.o src/filter/chain_filter_plugin.c &&\
:info:build     mv -f $depbase.Tpo $depbase.Po
:info:build depbase=`echo src/filter/autoconvert_filter_plugin.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:build     /usr/bin/clang -DHAVE_CONFIG_H -I.  -DNDEBUG -I./src -D_REENTRANT -isystem /opt/local/include/glib-2.0 -isystem /opt/local/lib/glib-2.0/include -isystem /opt/local/include -DSYSTEM_CONFIG_FILE_LOCATION='"/opt/local/etc/mpd.conf"' -I/opt/local/include  -pipe -Os -I/opt/local/include -arch x86_64 -Wall -Wextra -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wwrite-strings -pedantic -MT src/filter/autoconvert_filter_plugin.o -MD -MP -MF $depbase.Tpo -c -o src/filter/autoconvert_filter_plugin.o src/filter/autoconvert_filter_plugin.c &&\
:info:build     mv -f $depbase.Tpo $depbase.Po
:info:build src/decoder/ffmpeg_decoder_plugin.c:302:26: error: use of undeclared identifier 'AVCODEC_MAX_AUDIO_FRAME_SIZE'
:info:build         uint8_t aligned_buffer[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
:info:build                                 ^
:info:build 1 error generated.
:info:build make[1]: *** [src/decoder/libdecoder_plugins_a-ffmpeg_decoder_plugin.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_audio_mpd/mpd/work/mpd-0.17.5'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_audio_mpd/mpd/work/mpd-0.17.5'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_audio_mpd/mpd/work/mpd-0.17.5" && /usr/bin/make -j4 -w all
:info:build Exit code: 2
:error:build org.macports.build for port mpd returned: command execution failed
:debug:build Error code: CHILDSTATUS 41715 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"

Change History (6)

comment:1 Changed 11 years ago by max-arnold (Max Arnold)

Upstream bug report: http://bugs.musicpd.org/view.php?id=3805

diff -Naur mpd-0.17.5.orig/src/decoder/ffmpeg_decoder_plugin.c mpd-0.17.5/src/decoder/ffmpeg_decoder_plugin.c
--- src/decoder/ffmpeg_decoder_plugin.c	2013-08-04 19:20:16.000000000 +0700
+++ src/decoder/ffmpeg_decoder_plugin.c	2013-09-28 13:25:06.000000000 +0700
@@ -47,6 +47,8 @@
 #undef G_LOG_DOMAIN
 #define G_LOG_DOMAIN "ffmpeg"

+#define MAX_AUDIO_FRAME_SIZE 192000
+
 static GLogLevelFlags
 level_ffmpeg_to_glib(int level)
 {
@@ -299,11 +301,11 @@
 #endif

 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0)
-	uint8_t aligned_buffer[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
+	uint8_t aligned_buffer[(MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
 	const size_t buffer_size = sizeof(aligned_buffer);
 #else
 	/* libavcodec < 0.8 needs an aligned buffer */
-	uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
+	uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
 	size_t buffer_size = sizeof(audio_buf);
 	int16_t *aligned_buffer = align16(audio_buf, &buffer_size);
 #endif

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to rmstonecipher@…
Port: mpd added

comment:3 Changed 11 years ago by mf2k (Frank Schima)

This is similar to #40581 in gpac and is due to the move to ffmpeg 2.0.

comment:4 Changed 11 years ago by dbevans (David B. Evans)

See fix in upstream git master here

comment:5 Changed 11 years ago by max-arnold (Max Arnold)

It looks like current upstream is rewritten using C++. Upstream patch can not be applied to released version.

comment:6 Changed 11 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Fix committed in r111824.

Note: See TracTickets for help on using tickets.