Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bae4f479
Commit
bae4f479
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adxenc: alloc/free coded_frame instead of keeping it in the ADXContext
parent
0588935e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
adx.h
libavcodec/adx.h
+0
-1
adxenc.c
libavcodec/adxenc.c
+13
-2
No files found.
libavcodec/adx.h
View file @
bae4f479
...
...
@@ -40,7 +40,6 @@ typedef struct ADXChannelState {
}
ADXChannelState
;
typedef
struct
ADXContext
{
AVFrame
frame
;
int
channels
;
ADXChannelState
prev
[
2
];
int
header_parsed
;
...
...
libavcodec/adxenc.c
View file @
bae4f479
...
...
@@ -107,6 +107,14 @@ static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
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
)
{
ADXContext
*
c
=
avctx
->
priv_data
;
...
...
@@ -118,8 +126,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
avctx
->
frame_size
=
BLOCK_SAMPLES
;
#if FF_API_OLD_ENCODE_AUDIO
avcodec_get_frame_defaults
(
&
c
->
frame
);
avctx
->
coded_frame
=
&
c
->
frame
;
if
(
!
(
avctx
->
coded_frame
=
avcodec_alloc_frame
()))
return
AVERROR
(
ENOMEM
)
;
#endif
/* the cutoff can be adjusted, but this seems to work pretty well */
...
...
@@ -169,6 +177,9 @@ AVCodec ff_adpcm_adx_encoder = {
.
id
=
AV_CODEC_ID_ADPCM_ADX
,
.
priv_data_size
=
sizeof
(
ADXContext
),
.
init
=
adx_encode_init
,
#if FF_API_OLD_ENCODE_AUDIO
.
close
=
adx_encode_close
,
#endif
.
encode2
=
adx_encode_frame
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment