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
bef3c14d
Commit
bef3c14d
authored
Jan 29, 2019
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/amrwbdec: Do not ignore NO_DATA frames.
Fixes the actual output duration of the sample in ticket #7113.
parent
56f59246
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
amrwbdata.h
libavcodec/amrwbdata.h
+1
-1
amrwbdec.c
libavcodec/amrwbdec.c
+8
-1
No files found.
libavcodec/amrwbdata.h
View file @
bef3c14d
...
@@ -1884,7 +1884,7 @@ static const float lpf_7_coef[31] = { // low pass, 7kHz cutoff
...
@@ -1884,7 +1884,7 @@ static const float lpf_7_coef[31] = { // low pass, 7kHz cutoff
/** Core frame sizes in each mode */
/** Core frame sizes in each mode */
static
const
uint16_t
cf_sizes_wb
[]
=
{
static
const
uint16_t
cf_sizes_wb
[]
=
{
132
,
177
,
253
,
285
,
317
,
365
,
397
,
461
,
477
,
132
,
177
,
253
,
285
,
317
,
365
,
397
,
461
,
477
,
40
/// SID/comfort noise frame
40
,
0
,
0
,
0
,
0
,
0
,
0
};
};
#endif
/* AVCODEC_AMRWBDATA_H */
#endif
/* AVCODEC_AMRWBDATA_H */
libavcodec/amrwbdec.c
View file @
bef3c14d
...
@@ -1119,12 +1119,19 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1119,12 +1119,19 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
buf_out
=
(
float
*
)
frame
->
data
[
0
];
buf_out
=
(
float
*
)
frame
->
data
[
0
];
header_size
=
decode_mime_header
(
ctx
,
buf
);
header_size
=
decode_mime_header
(
ctx
,
buf
);
expected_fr_size
=
((
cf_sizes_wb
[
ctx
->
fr_cur_mode
]
+
7
)
>>
3
)
+
1
;
if
(
ctx
->
fr_cur_mode
==
NO_DATA
)
{
for
(
i
=
0
;
i
<
frame
->
nb_samples
;
i
++
)
buf_out
[
i
]
=
0
.
f
;
*
got_frame_ptr
=
1
;
return
expected_fr_size
;
}
if
(
ctx
->
fr_cur_mode
>
MODE_SID
)
{
if
(
ctx
->
fr_cur_mode
>
MODE_SID
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid mode %d
\n
"
,
ctx
->
fr_cur_mode
);
"Invalid mode %d
\n
"
,
ctx
->
fr_cur_mode
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
expected_fr_size
=
((
cf_sizes_wb
[
ctx
->
fr_cur_mode
]
+
7
)
>>
3
)
+
1
;
if
(
buf_size
<
expected_fr_size
)
{
if
(
buf_size
<
expected_fr_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
...
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