Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
82cea7cb
Commit
82cea7cb
authored
Jul 13, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: prefer passing AC3EncodeContext rather than AVCodecContext
parent
f501157e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
ac3enc.c
libavcodec/ac3enc.c
+12
-11
ac3enc.h
libavcodec/ac3enc.h
+1
-1
ac3enc_template.c
libavcodec/ac3enc_template.c
+1
-1
No files found.
libavcodec/ac3enc.c
View file @
82cea7cb
...
@@ -1535,10 +1535,10 @@ void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame)
...
@@ -1535,10 +1535,10 @@ void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame)
}
}
static
void
dprint_options
(
A
VCodecContext
*
avctx
)
static
void
dprint_options
(
A
C3EncodeContext
*
s
)
{
{
#ifdef DEBUG
#ifdef DEBUG
A
C3EncodeContext
*
s
=
avctx
->
priv_data
;
A
VCodecContext
*
avctx
=
s
->
avctx
;
AC3EncOptions
*
opt
=
&
s
->
options
;
AC3EncOptions
*
opt
=
&
s
->
options
;
char
strbuf
[
32
];
char
strbuf
[
32
];
...
@@ -1689,9 +1689,9 @@ static void validate_mix_level(void *log_ctx, const char *opt_name,
...
@@ -1689,9 +1689,9 @@ static void validate_mix_level(void *log_ctx, const char *opt_name,
* Validate metadata options as set by AVOption system.
* Validate metadata options as set by AVOption system.
* These values can optionally be changed per-frame.
* These values can optionally be changed per-frame.
*/
*/
int
ff_ac3_validate_metadata
(
A
VCodecContext
*
avctx
)
int
ff_ac3_validate_metadata
(
A
C3EncodeContext
*
s
)
{
{
A
C3EncodeContext
*
s
=
avctx
->
priv_data
;
A
VCodecContext
*
avctx
=
s
->
avctx
;
AC3EncOptions
*
opt
=
&
s
->
options
;
AC3EncOptions
*
opt
=
&
s
->
options
;
/* validate mixing levels */
/* validate mixing levels */
...
@@ -1892,8 +1892,9 @@ static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
...
@@ -1892,8 +1892,9 @@ static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
}
}
static
av_cold
int
validate_options
(
A
VCodecContext
*
avctx
,
A
C3EncodeContext
*
s
)
static
av_cold
int
validate_options
(
AC3EncodeContext
*
s
)
{
{
AVCodecContext
*
avctx
=
s
->
avctx
;
int
i
,
ret
,
max_sr
;
int
i
,
ret
,
max_sr
;
/* validate channel layout */
/* validate channel layout */
...
@@ -1998,7 +1999,7 @@ static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
...
@@ -1998,7 +1999,7 @@ static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s)
}
}
if
(
!
s
->
eac3
)
{
if
(
!
s
->
eac3
)
{
ret
=
ff_ac3_validate_metadata
(
avctx
);
ret
=
ff_ac3_validate_metadata
(
s
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
}
}
...
@@ -2085,10 +2086,10 @@ static av_cold void set_bandwidth(AC3EncodeContext *s)
...
@@ -2085,10 +2086,10 @@ static av_cold void set_bandwidth(AC3EncodeContext *s)
}
}
static
av_cold
int
allocate_buffers
(
A
VCodecContext
*
avctx
)
static
av_cold
int
allocate_buffers
(
A
C3EncodeContext
*
s
)
{
{
AVCodecContext
*
avctx
=
s
->
avctx
;
int
blk
,
ch
;
int
blk
,
ch
;
AC3EncodeContext
*
s
=
avctx
->
priv_data
;
int
channels
=
s
->
channels
+
1
;
/* includes coupling channel */
int
channels
=
s
->
channels
+
1
;
/* includes coupling channel */
if
(
s
->
allocate_sample_buffers
(
s
))
if
(
s
->
allocate_sample_buffers
(
s
))
...
@@ -2201,7 +2202,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
...
@@ -2201,7 +2202,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
ff_ac3_common_init
();
ff_ac3_common_init
();
ret
=
validate_options
(
avctx
,
s
);
ret
=
validate_options
(
s
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -2246,7 +2247,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
...
@@ -2246,7 +2247,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
if
(
ret
)
if
(
ret
)
goto
init_fail
;
goto
init_fail
;
ret
=
allocate_buffers
(
avctx
);
ret
=
allocate_buffers
(
s
);
if
(
ret
)
if
(
ret
)
goto
init_fail
;
goto
init_fail
;
...
@@ -2255,7 +2256,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
...
@@ -2255,7 +2256,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
dsputil_init
(
&
s
->
dsp
,
avctx
);
dsputil_init
(
&
s
->
dsp
,
avctx
);
ff_ac3dsp_init
(
&
s
->
ac3dsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
ff_ac3dsp_init
(
&
s
->
ac3dsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
dprint_options
(
avctx
);
dprint_options
(
s
);
return
0
;
return
0
;
init_fail:
init_fail:
...
...
libavcodec/ac3enc.h
View file @
82cea7cb
...
@@ -243,7 +243,7 @@ int ff_ac3_encode_init(AVCodecContext *avctx);
...
@@ -243,7 +243,7 @@ int ff_ac3_encode_init(AVCodecContext *avctx);
int
ff_ac3_encode_close
(
AVCodecContext
*
avctx
);
int
ff_ac3_encode_close
(
AVCodecContext
*
avctx
);
int
ff_ac3_validate_metadata
(
A
VCodecContext
*
avctx
);
int
ff_ac3_validate_metadata
(
A
C3EncodeContext
*
s
);
void
ff_ac3_adjust_frame_size
(
AC3EncodeContext
*
s
);
void
ff_ac3_adjust_frame_size
(
AC3EncodeContext
*
s
);
...
...
libavcodec/ac3enc_template.c
View file @
82cea7cb
...
@@ -424,7 +424,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, unsigned char *frame,
...
@@ -424,7 +424,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, unsigned char *frame,
int
ret
;
int
ret
;
if
(
!
s
->
eac3
&&
s
->
options
.
allow_per_frame_metadata
)
{
if
(
!
s
->
eac3
&&
s
->
options
.
allow_per_frame_metadata
)
{
ret
=
ff_ac3_validate_metadata
(
avctx
);
ret
=
ff_ac3_validate_metadata
(
s
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
}
}
...
...
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