mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType
Commits957a593cd9
and11828b8885
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 since2215c39e94
(merged in commit52c522c720
) 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@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
82352f3c1a
commit
55c7bb0665
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user