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
128dda70
Commit
128dda70
authored
Apr 28, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add a sample_rate field to AVFrame.
The field is filled with the codec context information.
parent
4b0521ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
avcodec.h
libavcodec/avcodec.h
+9
-0
options.c
libavcodec/options.c
+1
-0
utils.c
libavcodec/utils.c
+2
-0
No files found.
libavcodec/avcodec.h
View file @
128dda70
...
@@ -1267,6 +1267,15 @@ typedef struct AVFrame {
...
@@ -1267,6 +1267,15 @@ typedef struct AVFrame {
*/
*/
int64_t
channel_layout
;
int64_t
channel_layout
;
/**
* sample rate of the audio frame
* - encoding: unused
* - decoding: read by user.
* Code outside libavcodec should access this field using:
* av_opt_ptr(avcodec_get_frame_class(), frame, "sample_rate")
*/
int
sample_rate
;
}
AVFrame
;
}
AVFrame
;
struct
AVCodecInternal
;
struct
AVCodecInternal
;
...
...
libavcodec/options.c
View file @
128dda70
...
@@ -240,6 +240,7 @@ static const AVOption frame_options[]={
...
@@ -240,6 +240,7 @@ static const AVOption frame_options[]={
{
"height"
,
""
,
FOFFSET
(
height
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
0
},
{
"height"
,
""
,
FOFFSET
(
height
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
0
},
{
"format"
,
""
,
FOFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
dbl
=
-
1
},
0
,
INT_MAX
,
0
},
{
"format"
,
""
,
FOFFSET
(
format
),
AV_OPT_TYPE_INT
,
{.
dbl
=
-
1
},
0
,
INT_MAX
,
0
},
{
"channel_layout"
,
""
,
FOFFSET
(
channel_layout
),
AV_OPT_TYPE_INT64
,
{.
dbl
=
0
},
0
,
INT64_MAX
,
0
},
{
"channel_layout"
,
""
,
FOFFSET
(
channel_layout
),
AV_OPT_TYPE_INT64
,
{.
dbl
=
0
},
0
,
INT64_MAX
,
0
},
{
"sample_rate"
,
""
,
FOFFSET
(
sample_rate
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
0
},
{
NULL
},
{
NULL
},
};
};
...
...
libavcodec/utils.c
View file @
128dda70
...
@@ -1547,6 +1547,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
...
@@ -1547,6 +1547,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
frame
->
format
=
avctx
->
sample_fmt
;
frame
->
format
=
avctx
->
sample_fmt
;
if
(
!
frame
->
channel_layout
)
if
(
!
frame
->
channel_layout
)
frame
->
channel_layout
=
avctx
->
channel_layout
;
frame
->
channel_layout
=
avctx
->
channel_layout
;
if
(
!
frame
->
sample_rate
)
frame
->
sample_rate
=
avctx
->
sample_rate
;
}
}
avctx
->
pkt
=
NULL
;
avctx
->
pkt
=
NULL
;
...
...
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