[FFmpeg-cvslog] avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType

Andreas Rheinhardt git at videolan.org
Mon Jun 22 13:32:09 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Jun 21 05:17:08 2020 +0200| [55c7bb0665c4e2d2f39025fb04428f5c5764dc8c] | committer: Andreas Rheinhardt

avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType

Commits 957a593cd95b15a5dcb2f50306fbac59f09d8e9e and
11828b8885cc1d87ffc7b1b4bbe642ce9720b194 made the flv demuxer export
a certain flag as side data to be used by the nellymoser decoder for
mid-stream sample rate changes. It used a custom side data type 'F' that
was never officially documented.

Yet since 2215c39e94e01f57b3191a29e0e51d7e230daf49 (merged in commit
52c522c72090233edeeb0486a9bd8bee925a710a) this information is exported
via the properly documented AV_PKT_DATA_PARAM_CHANGE side data.
The merge commit therefore stopped exporting the 'F' sidedata; yet the
changes in the Nellymoser decoder (which are now dead code (and would
become dangerous if lots of new side data types were added)) have not
been removed. This commit does this.

Reviewed-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55c7bb0665c4e2d2f39025fb04428f5c5764dc8c
---

 libavcodec/nellymoserdec.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index b0deb79cf5..d667d9ce79 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -143,7 +143,6 @@ static int decode_tag(AVCodecContext *avctx, void *data,
 {
     AVFrame *frame     = data;
     const uint8_t *buf = avpkt->data;
-    const uint8_t *side=av_packet_get_side_data(avpkt, 'F', NULL);
     int buf_size = avpkt->size;
     NellyMoserDecodeContext *s = avctx->priv_data;
     int blocks, i, ret;
@@ -160,15 +159,6 @@ static int decode_tag(AVCodecContext *avctx, void *data,
         av_log(avctx, AV_LOG_WARNING, "Leftover bytes: %d.\n",
                buf_size % NELLY_BLOCK_LEN);
     }
-    /* Normal numbers of blocks for sample rates:
-     *  8000 Hz - 1
-     * 11025 Hz - 2
-     * 16000 Hz - 3
-     * 22050 Hz - 4
-     * 44100 Hz - 8
-     */
-    if(side && blocks>1 && avctx->sample_rate%11025==0 && (1<<((side[0]>>2)&3)) == blocks)
-        avctx->sample_rate= 11025*(blocks/2);
 
     /* get output buffer */
     frame->nb_samples = NELLY_SAMPLES * blocks;



More information about the ffmpeg-cvslog mailing list