summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-02-27 21:31:22 +0000
committerRodeo <[email protected]>2013-02-27 21:31:22 +0000
commit33825e896ce8f264e407050a13bcda0475a52758 (patch)
treed9931399726a452b811dcaa1bc2bf2abedc03565
parentc8d8a0798c645c4ddf8b4318a8310ee96883dd18 (diff)
Bump Libav to v9.2.
Miscellaneous fixes. Also reduces the amount of patched code a bit. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5272 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--contrib/ffmpeg/A02-h264-recovery-point.patch (renamed from contrib/ffmpeg/A03-h264-recovery-point.patch)8
-rw-r--r--contrib/ffmpeg/A02-truehd-channel-order.patch207
-rw-r--r--contrib/ffmpeg/A03-dca-resync.patch (renamed from contrib/ffmpeg/A04-dca-resync.patch)0
-rw-r--r--contrib/ffmpeg/A04-truehd-downmix.patch (renamed from contrib/ffmpeg/A05-truehd-downmix.patch)17
-rw-r--r--contrib/ffmpeg/P01-solaris.patch4
-rw-r--r--contrib/ffmpeg/P02-darwin-pic.patch6
-rw-r--r--contrib/ffmpeg/module.defs2
7 files changed, 12 insertions, 232 deletions
diff --git a/contrib/ffmpeg/A03-h264-recovery-point.patch b/contrib/ffmpeg/A02-h264-recovery-point.patch
index 78c182df2..8688c021c 100644
--- a/contrib/ffmpeg/A03-h264-recovery-point.patch
+++ b/contrib/ffmpeg/A02-h264-recovery-point.patch
@@ -1,8 +1,8 @@
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
-index 3660597..bf4e072 100644
+index 848d6a2..5a12fdb 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
-@@ -2163,6 +2163,7 @@ static void flush_dpb(AVCodecContext *avctx)
+@@ -2164,6 +2164,7 @@ static void flush_dpb(AVCodecContext *avctx)
flush_change(h);
ff_mpeg_flush(avctx);
@@ -10,7 +10,7 @@ index 3660597..bf4e072 100644
}
static int init_poc(H264Context *h)
-@@ -3981,9 +3982,18 @@ again:
+@@ -3992,9 +3993,18 @@ again:
if ((err = decode_slice_header(hx, h)))
break;
@@ -32,7 +32,7 @@ index 3660597..bf4e072 100644
if (h->current_slice == 1) {
if (!(s->flags2 & CODEC_FLAG2_CHUNKS))
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
-index 8596121..23daee3 100644
+index 898ebf7..42aaa6f 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -568,6 +568,13 @@ typedef struct H264Context {
diff --git a/contrib/ffmpeg/A02-truehd-channel-order.patch b/contrib/ffmpeg/A02-truehd-channel-order.patch
deleted file mode 100644
index a3d767755..000000000
--- a/contrib/ffmpeg/A02-truehd-channel-order.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
-index d1a3dc1..31c79c9 100644
---- a/libavcodec/mlp_parser.c
-+++ b/libavcodec/mlp_parser.c
-@@ -126,7 +126,7 @@ static uint64_t truehd_layout(int chanmap)
-
- int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
- {
-- int ratebits;
-+ int ratebits, channel_arrangement;
- uint16_t checksum;
-
- assert(get_bits_count(gb) == 0);
-@@ -157,7 +157,9 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
-
- skip_bits(gb, 11);
-
-- mh->channels_mlp = get_bits(gb, 5);
-+ channel_arrangement = get_bits(gb, 5);
-+ mh->channels_mlp = mlp_channels[channel_arrangement];
-+ mh->channel_layout_mlp = mlp_layout[channel_arrangement];
- } else if (mh->stream_type == 0xba) {
- mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
- mh->group2_bits = 0;
-@@ -168,11 +170,15 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
-
- skip_bits(gb, 8);
-
-- mh->channels_thd_stream1 = get_bits(gb, 5);
-+ channel_arrangement = get_bits(gb, 5);
-+ mh->channels_thd_stream1 = truehd_channels(channel_arrangement);
-+ mh->channel_layout_thd_stream1 = truehd_layout(channel_arrangement);
-
- skip_bits(gb, 2);
-
-- mh->channels_thd_stream2 = get_bits(gb, 13);
-+ channel_arrangement = get_bits(gb, 13);
-+ mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
-+ mh->channel_layout_thd_stream2 = truehd_layout(channel_arrangement);
- } else
- return AVERROR_INVALIDDATA;
-
-@@ -316,16 +322,16 @@ static int mlp_parse(AVCodecParserContext *s,
-
- if (mh.stream_type == 0xbb) {
- /* MLP stream */
-- avctx->channels = mlp_channels[mh.channels_mlp];
-- avctx->channel_layout = mlp_layout[mh.channels_mlp];
-+ avctx->channels = mh.channels_mlp;
-+ avctx->channel_layout = mh.channel_layout_mlp;
- } else { /* mh.stream_type == 0xba */
- /* TrueHD stream */
- if (mh.channels_thd_stream2) {
-- avctx->channels = truehd_channels(mh.channels_thd_stream2);
-- avctx->channel_layout = truehd_layout(mh.channels_thd_stream2);
-+ avctx->channels = mh.channels_thd_stream2;
-+ avctx->channel_layout = mh.channel_layout_thd_stream2;
- } else {
-- avctx->channels = truehd_channels(mh.channels_thd_stream1);
-- avctx->channel_layout = truehd_layout(mh.channels_thd_stream1);
-+ avctx->channels = mh.channels_thd_stream1;
-+ avctx->channel_layout = mh.channel_layout_thd_stream1;
- }
- }
-
-diff --git a/libavcodec/mlp_parser.h b/libavcodec/mlp_parser.h
-index 35bb312..e874426 100644
---- a/libavcodec/mlp_parser.h
-+++ b/libavcodec/mlp_parser.h
-@@ -31,25 +31,28 @@
-
- typedef struct MLPHeaderInfo
- {
-- int stream_type; ///< 0xBB for MLP, 0xBA for TrueHD
-+ int stream_type; ///< 0xBB for MLP, 0xBA for TrueHD
-
-- int group1_bits; ///< The bit depth of the first substream
-- int group2_bits; ///< Bit depth of the second substream (MLP only)
-+ int group1_bits; ///< The bit depth of the first substream
-+ int group2_bits; ///< Bit depth of the second substream (MLP only)
-
-- int group1_samplerate; ///< Sample rate of first substream
-- int group2_samplerate; ///< Sample rate of second substream (MLP only)
-+ int group1_samplerate; ///< Sample rate of first substream
-+ int group2_samplerate; ///< Sample rate of second substream (MLP only)
-
-- int channels_mlp; ///< Channel arrangement for MLP streams
-- int channels_thd_stream1; ///< Channel arrangement for substream 1 of TrueHD streams (5.1)
-- int channels_thd_stream2; ///< Channel arrangement for substream 2 of TrueHD streams (7.1)
-+ int channels_mlp; ///< Channel count for MLP streams
-+ int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
-+ int channels_thd_stream2; ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation")
-+ uint64_t channel_layout_mlp; ///< Channel layout for MLP streams
-+ uint64_t channel_layout_thd_stream1; ///< Channel layout for substream 1 of TrueHD streams ("6-channel presentation")
-+ uint64_t channel_layout_thd_stream2; ///< Channel layout for substream 2 of TrueHD streams ("8-channel presentation")
-
-- int access_unit_size; ///< Number of samples per coded frame
-- int access_unit_size_pow2; ///< Next power of two above number of samples per frame
-+ int access_unit_size; ///< Number of samples per coded frame
-+ int access_unit_size_pow2; ///< Next power of two above number of samples per frame
-
-- int is_vbr; ///< Stream is VBR instead of CBR
-- int peak_bitrate; ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR
-+ int is_vbr; ///< Stream is VBR instead of CBR
-+ int peak_bitrate; ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR
-
-- int num_substreams; ///< Number of substreams within stream
-+ int num_substreams; ///< Number of substreams within stream
- } MLPHeaderInfo;
-
-
-diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
-index 3852f6e..f8c647a 100644
---- a/libavcodec/mlpdec.c
-+++ b/libavcodec/mlpdec.c
-@@ -28,6 +28,7 @@
-
- #include "avcodec.h"
- #include "libavutil/intreadwrite.h"
-+#include "libavutil/channel_layout.h"
- #include "get_bits.h"
- #include "internal.h"
- #include "libavutil/crc.h"
-@@ -56,6 +57,8 @@ typedef struct SubStream {
- uint8_t max_matrix_channel;
- /// For each channel output by the matrix, the output channel to map it to
- uint8_t ch_assign[MAX_CHANNELS];
-+ /// The channel layout for this substream
-+ uint64_t ch_layout;
-
- /// Channel coding parameters for channels in the substream
- ChannelParams channel_params[MAX_CHANNELS];
-@@ -146,6 +149,36 @@ typedef struct MLPDecodeContext {
- MLPDSPContext dsp;
- } MLPDecodeContext;
-
-+static const uint64_t thd_channel_order[] = {
-+ AV_CH_FRONT_LEFT, AV_CH_FRONT_RIGHT, // LR
-+ AV_CH_FRONT_CENTER, // C
-+ AV_CH_LOW_FREQUENCY, // LFE
-+ AV_CH_SIDE_LEFT, AV_CH_SIDE_RIGHT, // LRs
-+ AV_CH_TOP_FRONT_LEFT, AV_CH_TOP_FRONT_RIGHT, // LRvh
-+ AV_CH_FRONT_LEFT_OF_CENTER, AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
-+ AV_CH_BACK_LEFT, AV_CH_BACK_RIGHT, // LRrs
-+ AV_CH_BACK_CENTER, // Cs
-+ AV_CH_TOP_CENTER, // Ts
-+ AV_CH_SURROUND_DIRECT_LEFT, AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
-+ AV_CH_WIDE_LEFT, AV_CH_WIDE_RIGHT, // LRw
-+ AV_CH_TOP_FRONT_CENTER, // Cvh
-+ AV_CH_LOW_FREQUENCY_2, // LFE2
-+};
-+
-+static uint64_t thd_channel_layout_extract_channel(uint64_t channel_layout,
-+ int index)
-+{
-+ int i;
-+
-+ if (av_get_channel_layout_nb_channels(channel_layout) <= index)
-+ return 0;
-+
-+ for (i = 0; i < FF_ARRAY_ELEMS(thd_channel_order); i++)
-+ if (channel_layout & thd_channel_order[i] && !index--)
-+ return thd_channel_order[i];
-+ return 0;
-+}
-+
- static VLC huff_vlc[3];
-
- /** Initialize static data, constant between all invocations of the codec. */
-@@ -325,6 +358,24 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
- for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
- m->substream[substr].restart_seen = 0;
-
-+ /* Set the layout for each substream. When there's more than one, the first
-+ * substream is Stereo. Subsequent substreams' layouts are indicated in the
-+ * major sync. */
-+ if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
-+ if ((substr = (mh.num_substreams > 1)))
-+ m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
-+ m->substream[substr].ch_layout = mh.channel_layout_mlp;
-+ } else {
-+ if ((substr = (mh.num_substreams > 1)))
-+ m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
-+ if (mh.num_substreams > 2)
-+ if (mh.channel_layout_thd_stream2)
-+ m->substream[2].ch_layout = mh.channel_layout_thd_stream2;
-+ else
-+ m->substream[2].ch_layout = mh.channel_layout_thd_stream1;
-+ m->substream[substr].ch_layout = mh.channel_layout_thd_stream1;
-+ }
-+
- return 0;
- }
-
-@@ -426,6 +477,12 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
-
- for (ch = 0; ch <= s->max_matrix_channel; ch++) {
- int ch_assign = get_bits(gbp, 6);
-+ if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
-+ uint64_t channel = thd_channel_layout_extract_channel(s->ch_layout,
-+ ch_assign);
-+ ch_assign = av_get_channel_layout_channel_index(s->ch_layout,
-+ channel);
-+ }
- if (ch_assign > s->max_matrix_channel) {
- av_log_ask_for_sample(m->avctx,
- "Assignment of matrix channel %d to invalid output channel %d.\n",
diff --git a/contrib/ffmpeg/A04-dca-resync.patch b/contrib/ffmpeg/A03-dca-resync.patch
index bbd9ad7ed..bbd9ad7ed 100644
--- a/contrib/ffmpeg/A04-dca-resync.patch
+++ b/contrib/ffmpeg/A03-dca-resync.patch
diff --git a/contrib/ffmpeg/A05-truehd-downmix.patch b/contrib/ffmpeg/A04-truehd-downmix.patch
index 35344613f..9a9c18e13 100644
--- a/contrib/ffmpeg/A05-truehd-downmix.patch
+++ b/contrib/ffmpeg/A04-truehd-downmix.patch
@@ -1,8 +1,8 @@
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
-index 3852f6e..86aecf7 100644
+index 0eaf2e3..ef1812d 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
-@@ -394,14 +394,24 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
+@@ -445,14 +445,24 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
return AVERROR_INVALIDDATA;
}
@@ -31,16 +31,3 @@ index 3852f6e..86aecf7 100644
}
s->noise_shift = get_bits(gbp, 4);
-@@ -463,8 +473,10 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
- cp->huff_lsbs = 24;
- }
-
-- if (substr == m->max_decoded_substream)
-- m->avctx->channels = s->max_matrix_channel + 1;
-+ if (substr == m->max_decoded_substream) {
-+ m->avctx->channels = s->max_matrix_channel + 1;
-+ m->avctx->channel_layout = s->ch_layout;
-+ }
-
- return 0;
- }
diff --git a/contrib/ffmpeg/P01-solaris.patch b/contrib/ffmpeg/P01-solaris.patch
index 0a2355f91..29633e323 100644
--- a/contrib/ffmpeg/P01-solaris.patch
+++ b/contrib/ffmpeg/P01-solaris.patch
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
-index e87a326..5ccfc0f 100755
+index aa31ea0..773e6bf 100755
--- a/configure
+++ b/configure
-@@ -3156,7 +3156,7 @@ EOF
+@@ -3167,7 +3167,7 @@ EOF
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
diff --git a/contrib/ffmpeg/P02-darwin-pic.patch b/contrib/ffmpeg/P02-darwin-pic.patch
index 0e0a08429..b3f883eae 100644
--- a/contrib/ffmpeg/P02-darwin-pic.patch
+++ b/contrib/ffmpeg/P02-darwin-pic.patch
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
-index e87a326..422a7a5 100755
+index aa31ea0..a7f5380 100755
--- a/configure
+++ b/configure
-@@ -2878,6 +2878,7 @@ case $target_os in
+@@ -2889,6 +2889,7 @@ case $target_os in
AVSERVERLDFLAGS=-Wl,-bind_at_load
objformat="macho"
enabled x86_64 && objformat="macho64"
@@ -10,7 +10,7 @@ index e87a326..422a7a5 100755
enabled_any pic shared ||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
;;
-@@ -3080,7 +3081,7 @@ esc(){
+@@ -3091,7 +3092,7 @@ esc(){
echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate
diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs
index 3fa360fc1..0be57e997 100644
--- a/contrib/ffmpeg/module.defs
+++ b/contrib/ffmpeg/module.defs
@@ -1,7 +1,7 @@
$(eval $(call import.MODULE.defs,FFMPEG,ffmpeg,YASM BZIP2 ZLIB))
$(eval $(call import.CONTRIB.defs,FFMPEG))
-FFMPEG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libav-v9.1.tar.bz2
+FFMPEG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libav-v9.2.tar.bz2
FFMPEG.CONFIGURE.deps =
FFMPEG.CONFIGURE.env =