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
bae4f479
Commit
bae4f479
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
adxenc: alloc/free coded_frame instead of keeping it in the ADXContext
parent
0588935e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/adx.h
+0
-1
0 additions, 1 deletion
libavcodec/adx.h
libavcodec/adxenc.c
+13
-2
13 additions, 2 deletions
libavcodec/adxenc.c
with
13 additions
and
3 deletions
libavcodec/adx.h
+
0
−
1
View file @
bae4f479
...
@@ -40,7 +40,6 @@ typedef struct ADXChannelState {
...
@@ -40,7 +40,6 @@ typedef struct ADXChannelState {
}
ADXChannelState
;
}
ADXChannelState
;
typedef
struct
ADXContext
{
typedef
struct
ADXContext
{
AVFrame
frame
;
int
channels
;
int
channels
;
ADXChannelState
prev
[
2
];
ADXChannelState
prev
[
2
];
int
header_parsed
;
int
header_parsed
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/adxenc.c
+
13
−
2
View file @
bae4f479
...
@@ -107,6 +107,14 @@ static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
...
@@ -107,6 +107,14 @@ static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
return
HEADER_SIZE
;
return
HEADER_SIZE
;
}
}
#if FF_API_OLD_ENCODE_AUDIO
static
av_cold
int
adx_encode_close
(
AVCodecContext
*
avctx
)
{
av_freep
(
&
avctx
->
coded_frame
);
return
0
;
}
#endif
static
av_cold
int
adx_encode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
adx_encode_init
(
AVCodecContext
*
avctx
)
{
{
ADXContext
*
c
=
avctx
->
priv_data
;
ADXContext
*
c
=
avctx
->
priv_data
;
...
@@ -118,8 +126,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
...
@@ -118,8 +126,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
avctx
->
frame_size
=
BLOCK_SAMPLES
;
avctx
->
frame_size
=
BLOCK_SAMPLES
;
#if FF_API_OLD_ENCODE_AUDIO
#if FF_API_OLD_ENCODE_AUDIO
avcodec_get_frame_defaults
(
&
c
->
frame
)
;
if
(
!
(
avctx
->
coded_frame
=
avcodec_alloc_
frame
())
)
avctx
->
coded_frame
=
&
c
->
frame
;
return
AVERROR
(
ENOMEM
)
;
#endif
#endif
/* the cutoff can be adjusted, but this seems to work pretty well */
/* the cutoff can be adjusted, but this seems to work pretty well */
...
@@ -169,6 +177,9 @@ AVCodec ff_adpcm_adx_encoder = {
...
@@ -169,6 +177,9 @@ AVCodec ff_adpcm_adx_encoder = {
.
id
=
AV_CODEC_ID_ADPCM_ADX
,
.
id
=
AV_CODEC_ID_ADPCM_ADX
,
.
priv_data_size
=
sizeof
(
ADXContext
),
.
priv_data_size
=
sizeof
(
ADXContext
),
.
init
=
adx_encode_init
,
.
init
=
adx_encode_init
,
#if FF_API_OLD_ENCODE_AUDIO
.
close
=
adx_encode_close
,
#endif
.
encode2
=
adx_encode_frame
,
.
encode2
=
adx_encode_frame
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
AV_SAMPLE_FMT_NONE
},
...
...
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