aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-03 19:01:59 +0000
committerAnton Khirnov <anton@khirnov.net>2014-07-09 13:37:18 +0000
commitd5cf5afabbf43f00283e70b12afbe1da030d85b6 (patch)
treef90930aaee18f386ddc35928d9fcf8186382efd0 /libavcodec
parentf6ee61fb05482c617f5deee29a190d8ff483b3d1 (diff)
downloadffmpeg-d5cf5afabbf43f00283e70b12afbe1da030d85b6.tar.gz
adxdec: get rid of an avpriv function
The only thing the demuxer needs is the sample rate to set the timebase, which can be simply read with AV_RB32.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavcodec/adx.c12
-rw-r--r--libavcodec/adx.h5
-rw-r--r--libavcodec/adxdec.c10
4 files changed, 20 insertions, 8 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 56aac3892f..7fa15d55f3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -556,7 +556,6 @@ OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
# libavformat dependencies
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
-OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
ac3tab.o
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o \
diff --git a/libavcodec/adx.c b/libavcodec/adx.c
index a9cf4ffd09..4d412d56d3 100644
--- a/libavcodec/adx.c
+++ b/libavcodec/adx.c
@@ -35,8 +35,8 @@ void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
coeff[1] = lrintf(-(c * c) * (1 << bits));
}
-int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
- int bufsize, int *header_size, int *coeff)
+int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
+ int bufsize, int *header_size, int *coeff)
{
int offset, cutoff;
@@ -80,3 +80,11 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
*header_size = offset;
return 0;
}
+
+#if LIBAVCODEC_VERSION_MAJOR < 56
+int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
+ int bufsize, int *header_size, int *coeff)
+{
+ return ff_adx_decode_header(avctx, buf, bufsize, header_size, coeff);
+}
+#endif
diff --git a/libavcodec/adx.h b/libavcodec/adx.h
index ff4c2d6f35..9328111012 100644
--- a/libavcodec/adx.h
+++ b/libavcodec/adx.h
@@ -74,7 +74,12 @@ void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff);
* @param[out] coeff 2 LPC coefficients, can be NULL
* @return data offset or negative error code if header is invalid
*/
+int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
+ int bufsize, int *header_size, int *coeff);
+
+#if LIBAVCODEC_VERSION_MAJOR < 56
int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
int bufsize, int *header_size, int *coeff);
+#endif
#endif /* AVCODEC_ADX_H */
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 17d5becc2b..14fddf5520 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -40,9 +40,9 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
int ret, header_size;
if (avctx->extradata_size >= 24) {
- if ((ret = avpriv_adx_decode_header(avctx, avctx->extradata,
- avctx->extradata_size, &header_size,
- c->coeff)) < 0) {
+ if ((ret = ff_adx_decode_header(avctx, avctx->extradata,
+ avctx->extradata_size, &header_size,
+ c->coeff)) < 0) {
av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
return AVERROR_INVALIDDATA;
}
@@ -110,8 +110,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
if (!c->header_parsed && buf_size >= 2 && AV_RB16(buf) == 0x8000) {
int header_size;
- if ((ret = avpriv_adx_decode_header(avctx, buf, buf_size, &header_size,
- c->coeff)) < 0) {
+ if ((ret = ff_adx_decode_header(avctx, buf, buf_size, &header_size,
+ c->coeff)) < 0) {
av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
return AVERROR_INVALIDDATA;
}