aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2014-01-22 11:17:59 -0800
committerMisty De Meo2014-01-22 12:59:03 -0800
commite253d34cbeeb39a7db5194c9c38feebd283e9f99 (patch)
tree7a9328b7bd52134ecb57a0281a23f1be518a0efb /Library
parent4e7f31e4a206c5815f352ac6541275648b7e0c7d (diff)
downloadhomebrew-e253d34cbeeb39a7db5194c9c38feebd283e9f99.tar.bz2
mpd: fix build on ffmpeg 2.x
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/mpd.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Formula/mpd.rb b/Library/Formula/mpd.rb
index ec5c1a2ed..3b8dffa2f 100644
--- a/Library/Formula/mpd.rb
+++ b/Library/Formula/mpd.rb
@@ -43,6 +43,10 @@ class Mpd < Formula
depends_on 'libvorbis' if build.with? 'vorbis' # Vorbis support
+ # Removes usage of deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE constant
+ # We're many versions behind; this bug has long since been fixed upstream
+ def patches; DATA; end
+
def install
if build.include? 'lastfm' or build.include? 'libwrap' \
or build.include? 'enable-soundcloud'
@@ -97,3 +101,23 @@ class Mpd < Formula
EOS
end
end
+
+__END__
+diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
+index 58bd2f5..65aa37f 100644
+--- a/src/decoder/ffmpeg_decoder_plugin.c
++++ b/src/decoder/ffmpeg_decoder_plugin.c
+@@ -299,11 +299,11 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
+ #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[(192000 * 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[(192000 * 3) / 2 + 16];
+ size_t buffer_size = sizeof(audio_buf);
+ int16_t *aligned_buffer = align16(audio_buf, &buffer_size);
+ #endif