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
94e6b5ac
Commit
94e6b5ac
authored
Jan 05, 2018
by
Misty De Meo
Committed by
Michael Niedermayer
Jan 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm: consume remainder after consuming XA chunks
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
fba00b74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
adpcm.c
libavcodec/adpcm.c
+7
-0
No files found.
libavcodec/adpcm.c
View file @
94e6b5ac
...
@@ -1115,6 +1115,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1115,6 +1115,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int16_t
*
out1
=
samples_p
[
1
];
int16_t
*
out1
=
samples_p
[
1
];
int
samples_per_block
=
28
*
(
3
-
avctx
->
channels
)
*
4
;
int
samples_per_block
=
28
*
(
3
-
avctx
->
channels
)
*
4
;
int
sample_offset
=
0
;
int
sample_offset
=
0
;
int
bytes_remaining
;
while
(
bytestream2_get_bytes_left
(
&
gb
)
>=
128
)
{
while
(
bytestream2_get_bytes_left
(
&
gb
)
>=
128
)
{
if
((
ret
=
xa_decode
(
avctx
,
out0
,
out1
,
buf
+
bytestream2_tell
(
&
gb
),
if
((
ret
=
xa_decode
(
avctx
,
out0
,
out1
,
buf
+
bytestream2_tell
(
&
gb
),
&
c
->
status
[
0
],
&
c
->
status
[
1
],
&
c
->
status
[
0
],
&
c
->
status
[
1
],
...
@@ -1123,6 +1124,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1123,6 +1124,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_skipu
(
&
gb
,
128
);
bytestream2_skipu
(
&
gb
,
128
);
sample_offset
+=
samples_per_block
;
sample_offset
+=
samples_per_block
;
}
}
/* Less than a full block of data left, e.g. when reading from
* 2324 byte per sector XA; the remainder is padding */
bytes_remaining
=
bytestream2_get_bytes_left
(
&
gb
);
if
(
bytes_remaining
>
0
)
{
bytestream2_skip
(
&
gb
,
bytes_remaining
);
}
break
;
break
;
}
}
case
AV_CODEC_ID_ADPCM_IMA_EA_EACS
:
case
AV_CODEC_ID_ADPCM_IMA_EA_EACS
:
...
...
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