Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
libaec
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mathis Rosenhauer
libaec
Commits
7bd95ff2
Commit
7bd95ff2
authored
Jan 15, 2016
by
Mathis Rosenhauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail with uneven output buffer only if it filled up.
parent
3a6b42c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/decode.c
src/decode.c
+9
-8
No files found.
src/decode.c
View file @
7bd95ff2
...
...
@@ -388,7 +388,7 @@ static inline void fs_drop(struct aec_stream *strm)
static
inline
uint32_t
copysample
(
struct
aec_stream
*
strm
)
{
if
(
bits_ask
(
strm
,
strm
->
bits_per_sample
)
==
0
||
strm
->
avail_out
==
0
)
||
strm
->
avail_out
<
strm
->
state
->
bytes_per_sample
)
return
0
;
put_sample
(
strm
,
bits_get
(
strm
,
strm
->
bits_per_sample
));
...
...
@@ -423,7 +423,7 @@ static int m_split_output(struct aec_stream *strm)
int
k
=
state
->
id
-
1
;
do
{
if
(
bits_ask
(
strm
,
k
)
==
0
||
strm
->
avail_out
==
0
)
if
(
bits_ask
(
strm
,
k
)
==
0
||
strm
->
avail_out
<
state
->
bytes_per_sample
)
return
M_EXIT
;
if
(
k
)
*
state
->
rsip
++
+=
bits_get
(
strm
,
k
);
...
...
@@ -502,7 +502,7 @@ static int m_zero_output(struct aec_stream *strm)
struct
internal_state
*
state
=
strm
->
state
;
do
{
if
(
strm
->
avail_out
==
0
)
if
(
strm
->
avail_out
<
state
->
bytes_per_sample
)
return
M_EXIT
;
put_sample
(
strm
,
0
);
}
while
(
--
state
->
i
);
...
...
@@ -565,13 +565,13 @@ static int m_se_decode(struct aec_stream *strm)
d1
=
m
-
state
->
se_table
[
2
*
m
+
1
];
if
((
state
->
i
&
1
)
==
0
)
{
if
(
strm
->
avail_out
==
0
)
if
(
strm
->
avail_out
<
state
->
bytes_per_sample
)
return
M_EXIT
;
put_sample
(
strm
,
state
->
se_table
[
2
*
m
]
-
d1
);
state
->
i
++
;
}
if
(
strm
->
avail_out
==
0
)
if
(
strm
->
avail_out
<
state
->
bytes_per_sample
)
return
M_EXIT
;
put_sample
(
strm
,
d1
);
state
->
i
++
;
...
...
@@ -804,9 +804,6 @@ int aec_decode(struct aec_stream *strm, int flush)
struct
internal_state
*
state
=
strm
->
state
;
int
status
;
if
(
strm
->
avail_out
%
strm
->
state
->
bytes_per_sample
)
return
AEC_MEM_ERROR
;
strm
->
total_in
+=
strm
->
avail_in
;
strm
->
total_out
+=
strm
->
avail_out
;
...
...
@@ -817,6 +814,10 @@ int aec_decode(struct aec_stream *strm, int flush)
if
(
status
==
M_ERROR
)
return
AEC_DATA_ERROR
;
if
(
status
==
M_EXIT
&&
strm
->
avail_out
>
0
&&
strm
->
avail_out
<
state
->
bytes_per_sample
)
return
AEC_MEM_ERROR
;
state
->
flush_output
(
strm
);
strm
->
total_in
-=
strm
->
avail_in
;
...
...
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