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
71f5712c
Commit
71f5712c
authored
Nov 04, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: Support flushing last samples out.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
259a960f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
swresample.c
libswresample/swresample.c
+22
-1
No files found.
libswresample/swresample.c
View file @
71f5712c
...
...
@@ -291,6 +291,25 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
out_count
=
in_count
;
}
if
(
!
in_arg
){
if
(
s
->
in_buffer_count
){
AudioData
*
a
=
&
s
->
in_buffer
;
int
i
,
j
,
ret
;
if
((
ret
=
realloc_audio
(
a
,
s
->
in_buffer_index
+
2
*
s
->
in_buffer_count
))
<
0
)
return
ret
;
av_assert0
(
a
->
planar
);
for
(
i
=
0
;
i
<
a
->
ch_count
;
i
++
){
for
(
j
=
0
;
j
<
s
->
in_buffer_count
;
j
++
){
memcpy
(
a
->
ch
[
i
]
+
(
s
->
in_buffer_index
+
s
->
in_buffer_count
+
j
)
*
a
->
bps
,
a
->
ch
[
i
]
+
(
s
->
in_buffer_index
+
s
->
in_buffer_count
-
j
-
1
)
*
a
->
bps
,
a
->
bps
);
}
}
s
->
in_buffer_count
+=
(
s
->
in_buffer_count
+
1
)
/
2
;
s
->
resample_in_constraint
=
0
;
}
else
{
return
0
;
}
}
else
fill_audiodata
(
in
,
(
void
*
)
in_arg
);
fill_audiodata
(
out
,
out_arg
);
...
...
@@ -365,6 +384,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
//FIXME packed doesnt need more than 1 chan here!
swr_audio_convert
(
s
->
out_convert
,
out
,
preout
,
out_count
);
}
if
(
!
in_arg
)
s
->
in_buffer_count
=
0
;
return
out_count
;
}
...
...
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