Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a2664c91
Commit
a2664c91
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
atrac3: move the 'samples_per_frame' field from ATRAC3Context to where it is used
parent
7c1f93af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/atrac3.c
+6
-7
6 additions, 7 deletions
libavcodec/atrac3.c
with
6 additions
and
7 deletions
libavcodec/atrac3.c
+
6
−
7
View file @
a2664c91
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment