Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c47f7874
Commit
c47f7874
authored
Nov 03, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
soxr: implement Flush/Drain
parent
004078f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
modules/audio_filter/resampler/soxr.c
modules/audio_filter/resampler/soxr.c
+29
-0
No files found.
modules/audio_filter/resampler/soxr.c
View file @
c47f7874
...
...
@@ -90,6 +90,8 @@ struct filter_sys_t
};
static
block_t
*
Resample
(
filter_t
*
,
block_t
*
);
static
block_t
*
Drain
(
filter_t
*
);
static
void
Flush
(
filter_t
*
);
static
bool
SoXR_GetFormat
(
vlc_fourcc_t
i_format
,
soxr_datatype_t
*
p_type
)
...
...
@@ -190,6 +192,8 @@ Open( vlc_object_t *p_obj, bool b_change_ratio )
p_filter
->
p_sys
=
p_sys
;
p_filter
->
pf_audio_filter
=
Resample
;
p_filter
->
pf_audio_flush
=
Flush
;
p_filter
->
pf_audio_drain
=
Drain
;
return
VLC_SUCCESS
;
}
...
...
@@ -364,3 +368,28 @@ Resample( filter_t *p_filter, block_t *p_in )
return
p_out
;
}
}
static
block_t
*
Drain
(
filter_t
*
p_filter
)
{
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
if
(
p_sys
->
last_soxr
&&
p_sys
->
i_last_olen
)
return
SoXR_Resample
(
p_filter
,
p_sys
->
last_soxr
,
NULL
,
p_sys
->
i_last_olen
);
else
return
NULL
;
}
static
void
Flush
(
filter_t
*
p_filter
)
{
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
if
(
p_sys
->
last_soxr
)
{
soxr_clear
(
p_sys
->
last_soxr
);
p_sys
->
i_last_olen
=
0
;
p_sys
->
last_soxr
=
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