[FFmpeg-devel] [PATCH] avcodec: remove old avpriv_mpa_decode_header function

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Wed Oct 21 00:57:15 CEST 2015


Replace its last use by avpriv_mpa_decode_header2 and drop the 2 suffix.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavcodec/mpegaudio_parser.c   | 2 +-
 libavcodec/mpegaudiodecheader.c | 7 +------
 libavcodec/mpegaudiodecheader.h | 4 +---
 libavformat/mp3dec.c            | 4 ++--
 4 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c
index 4c72131..4c7e778 100644
--- a/libavcodec/mpegaudio_parser.c
+++ b/libavcodec/mpegaudio_parser.c
@@ -69,7 +69,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
 
                 state= (state<<8) + buf[i++];
 
-                ret = avpriv_mpa_decode_header2(state, &sr, &channels, &frame_size, &bit_rate, &codec_id);
+                ret = avpriv_mpa_decode_header(state, &sr, &channels, &frame_size, &bit_rate, &codec_id);
                 if (ret < 4) {
                     if (i > 4)
                         s->header_count = -2;
diff --git a/libavcodec/mpegaudiodecheader.c b/libavcodec/mpegaudiodecheader.c
index d522c06..3d00586 100644
--- a/libavcodec/mpegaudiodecheader.c
+++ b/libavcodec/mpegaudiodecheader.c
@@ -113,7 +113,7 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
     return 0;
 }
 
-int avpriv_mpa_decode_header2(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate, enum AVCodecID *codec_id)
+int avpriv_mpa_decode_header(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate, enum AVCodecID *codec_id)
 {
     MPADecodeHeader s1, *s = &s1;
 
@@ -149,8 +149,3 @@ int avpriv_mpa_decode_header2(uint32_t head, int *sample_rate, int *channels, in
     *bit_rate = s->bit_rate;
     return s->frame_size;
 }
-
-int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate)
-{
-    return avpriv_mpa_decode_header2(head, sample_rate, channels, frame_size, bit_rate, &avctx->codec_id);
-}
diff --git a/libavcodec/mpegaudiodecheader.h b/libavcodec/mpegaudiodecheader.h
index 444b85f..e5e7bda 100644
--- a/libavcodec/mpegaudiodecheader.h
+++ b/libavcodec/mpegaudiodecheader.h
@@ -54,9 +54,7 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header);
 
 /* useful helper to get mpeg audio stream infos. Return -1 if error in
    header, otherwise the coded frame size in bytes */
-int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate);
-
-int avpriv_mpa_decode_header2(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate, enum AVCodecID *codec_id);
+int avpriv_mpa_decode_header(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate, enum AVCodecID *codec_id);
 
 /* fast header check for resync */
 static inline int ff_mpa_check_header(uint32_t header){
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 32ca00c..6829523 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -88,8 +88,8 @@ static int mp3_read_probe(AVProbeData *p)
         for(frames = 0; buf2 < end; frames++) {
             int dummy;
             header = AV_RB32(buf2);
-            fsize = avpriv_mpa_decode_header(avctx, header,
-                                             &dummy, &dummy, &dummy, &dummy);
+            fsize = avpriv_mpa_decode_header(header, &dummy, &dummy, &dummy,
+                                             &dummy, &avctx->codec_id);
             if(fsize < 0)
                 break;
             buf2 += fsize;
-- 
2.6.1


More information about the ffmpeg-devel mailing list