You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
atrac3: move the 'delay' field from ATRAC3Context to where it is used
This commit is contained in:
@@ -113,7 +113,6 @@ typedef struct ATRAC3Context {
|
|||||||
//@}
|
//@}
|
||||||
//@{
|
//@{
|
||||||
/** extradata */
|
/** extradata */
|
||||||
int delay;
|
|
||||||
int scrambled_stream;
|
int scrambled_stream;
|
||||||
int frame_factor;
|
int frame_factor;
|
||||||
//@}
|
//@}
|
||||||
@@ -853,7 +852,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
int version;
|
int version, delay;
|
||||||
const uint8_t *edata_ptr = avctx->extradata;
|
const uint8_t *edata_ptr = avctx->extradata;
|
||||||
ATRAC3Context *q = avctx->priv_data;
|
ATRAC3Context *q = avctx->priv_data;
|
||||||
static VLC_TYPE atrac3_vlc_table[4096][2];
|
static VLC_TYPE atrac3_vlc_table[4096][2];
|
||||||
@@ -886,7 +885,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
|||||||
/* setup */
|
/* setup */
|
||||||
q->samples_per_frame = SAMPLES_PER_FRAME * avctx->channels;
|
q->samples_per_frame = SAMPLES_PER_FRAME * avctx->channels;
|
||||||
version = 4;
|
version = 4;
|
||||||
q->delay = 0x88E;
|
delay = 0x88E;
|
||||||
q->coding_mode = q->coding_mode ? JOINT_STEREO : STEREO;
|
q->coding_mode = q->coding_mode ? JOINT_STEREO : STEREO;
|
||||||
q->scrambled_stream = 0;
|
q->scrambled_stream = 0;
|
||||||
|
|
||||||
@@ -902,7 +901,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
|||||||
/* Parse the extradata, RM format. */
|
/* Parse the extradata, RM format. */
|
||||||
version = bytestream_get_be32(&edata_ptr);
|
version = bytestream_get_be32(&edata_ptr);
|
||||||
q->samples_per_frame = bytestream_get_be16(&edata_ptr);
|
q->samples_per_frame = bytestream_get_be16(&edata_ptr);
|
||||||
q->delay = bytestream_get_be16(&edata_ptr);
|
delay = bytestream_get_be16(&edata_ptr);
|
||||||
q->coding_mode = bytestream_get_be16(&edata_ptr);
|
q->coding_mode = bytestream_get_be16(&edata_ptr);
|
||||||
q->samples_per_channel = q->samples_per_frame / avctx->channels;
|
q->samples_per_channel = q->samples_per_frame / avctx->channels;
|
||||||
q->scrambled_stream = 1;
|
q->scrambled_stream = 1;
|
||||||
@@ -926,9 +925,9 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q->delay != 0x88E) {
|
if (delay != 0x88E) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unknown amount of delay %x != 0x88E.\n",
|
av_log(avctx, AV_LOG_ERROR, "Unknown amount of delay %x != 0x88E.\n",
|
||||||
q->delay);
|
delay);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user