summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-18 22:50:40 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-10-22 10:10:07 -0400
commita2664c91fba15a1307f676ffad511f8f86fb3a27 (patch)
treed2e939b43aca94260719265f28da6b0a16ef2bee /libavcodec/atrac3.c
parent7c1f93afe6b03efc356442f748cb6daede8688ea (diff)
atrac3: move the 'samples_per_frame' field from ATRAC3Context to where it is used
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r--libavcodec/atrac3.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index e23ff9847e..3a6d4e84d6 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -92,7 +92,6 @@ typedef struct ATRAC3Context {
int coding_mode;
int bit_rate;
int sample_rate;
- int samples_per_frame;
ChannelUnit *units;
//@}
@@ -849,7 +848,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
{
int i, ret;
- int version, delay;
+ int version, delay, samples_per_frame;
const uint8_t *edata_ptr = avctx->extradata;
ATRAC3Context *q = avctx->priv_data;
static VLC_TYPE atrac3_vlc_table[4096][2];
@@ -878,7 +877,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
bytestream_get_le16(&edata_ptr)); // Unknown always 0
/* setup */
- q->samples_per_frame = SAMPLES_PER_FRAME * avctx->channels;
+ samples_per_frame = SAMPLES_PER_FRAME * avctx->channels;
version = 4;
delay = 0x88E;
q->coding_mode = q->coding_mode ? JOINT_STEREO : STEREO;
@@ -895,7 +894,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
} else if (avctx->extradata_size == 10) {
/* Parse the extradata, RM format. */
version = bytestream_get_be32(&edata_ptr);
- q->samples_per_frame = bytestream_get_be16(&edata_ptr);
+ samples_per_frame = bytestream_get_be16(&edata_ptr);
delay = bytestream_get_be16(&edata_ptr);
q->coding_mode = bytestream_get_be16(&edata_ptr);
q->scrambled_stream = 1;
@@ -912,10 +911,10 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- if (q->samples_per_frame != SAMPLES_PER_FRAME &&
- q->samples_per_frame != SAMPLES_PER_FRAME * 2) {
+ if (samples_per_frame != SAMPLES_PER_FRAME &&
+ samples_per_frame != SAMPLES_PER_FRAME * 2) {
av_log(avctx, AV_LOG_ERROR, "Unknown amount of samples per frame %d.\n",
- q->samples_per_frame);
+ samples_per_frame);
return AVERROR_INVALIDDATA;
}