Discussion:
[PATCH 2/3] ffmpeg: allow compilation with libavcodec < 52.2.0
Johannes Weißl
2011-05-31 13:53:19 UTC
Permalink
---
ffmpeg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index cd62c14..6cacbad 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -167,6 +167,7 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
int err = 0;
int i;
int stream_index = -1;
+ int64_t channel_layout = 0;
AVCodec *codec;
AVCodecContext *cc = NULL;
AVFormatContext *ic;
@@ -265,7 +266,10 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)
#ifdef WORDS_BIGENDIAN
ip_data->sf |= sf_bigendian(1);
#endif
- channel_map_init_waveex(cc->channels, cc->channel_layout, ip_data->channel_map);
+#if (LIBAVCODEC_VERSION_INT > ((52<<16)+(1<<8)+0))
+ channel_layout = cc->channel_layout;
+#endif
+ channel_map_init_waveex(cc->channels, channel_layout, ip_data->channel_map);
return 0;
}
--
1.7.5.3
Johannes Weißl
2011-05-31 13:53:20 UTC
Permalink
---
wavpack.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/wavpack.c b/wavpack.c
index 93acfa8..3765add 100644
--- a/wavpack.c
+++ b/wavpack.c
@@ -163,6 +163,7 @@ static int wavpack_open(struct input_plugin_data *ip_data)
struct wavpack_private *priv;
struct stat st;
char msg[80];
+ int channel_mask = 0;

const struct wavpack_private priv_init = {
.wv_file = {
@@ -210,7 +211,10 @@ static int wavpack_open(struct input_plugin_data *ip_data)
| sf_channels(WavpackGetReducedChannels(priv->wpc))
| sf_bits(WavpackGetBitsPerSample(priv->wpc))
| sf_signed(1);
- channel_map_init_waveex(sf_get_channels(ip_data->sf), WavpackGetChannelMask(priv->wpc), ip_data->channel_map);
+#if CUR_STREAM_VERS > 0x404
+ channel_mask = WavpackGetChannelMask(priv->wpc);
+#endif
+ channel_map_init_waveex(sf_get_channels(ip_data->sf), channel_mask, ip_data->channel_map);
return 0;
}
--
1.7.5.3
Gregory Petrosyan
2011-05-31 20:30:38 UTC
Permalink
---
ao.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
Thanks a lot, merged all 3!

Gregory

Loading...