Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
2c34c934
Commit
2c34c934
authored
Jan 06, 2014
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
twolame: implement flushing on close
parent
b381bf8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
modules/codec/twolame.c
modules/codec/twolame.c
+19
-3
No files found.
modules/codec/twolame.c
View file @
2c34c934
...
@@ -261,13 +261,29 @@ static void Bufferize( encoder_t *p_enc, int16_t *p_in, int i_nb_samples )
...
@@ -261,13 +261,29 @@ static void Bufferize( encoder_t *p_enc, int16_t *p_in, int i_nb_samples )
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
block_t
*
p_aout_buf
)
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
block_t
*
p_aout_buf
)
{
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
block_t
*
p_chain
=
NULL
;
if
(
unlikely
(
!
p_aout_buf
)
)
{
int
i_used
=
0
;
/* FIXME:p_aout_buf is NULL when it's time to flush, does twolame has buffer to flush?*/
i_used
=
twolame_encode_flush_interleaved
(
p_sys
->
p_twolame
,
if
(
unlikely
(
!
p_aout_buf
)
)
return
NULL
;
p_sys
->
p_out_buffer
,
MAX_CODED_FRAME_SIZE
);
if
(
i_used
<
0
)
return
NULL
;
p_block
=
block_Alloc
(
i_used
);
memcpy
(
p_block
->
p_buffer
,
p_sys
->
p_out_buffer
,
i_used
);
p_block
->
i_length
=
(
mtime_t
)
1000000
*
(
mtime_t
)
MPEG_FRAME_SIZE
/
(
mtime_t
)
p_enc
->
fmt_out
.
audio
.
i_rate
;
p_block
->
i_dts
=
p_block
->
i_pts
=
p_sys
->
i_pts
;
p_sys
->
i_pts
+=
p_block
->
i_length
;
return
p_block
;
}
int16_t
*
p_buffer
=
(
int16_t
*
)
p_aout_buf
->
p_buffer
;
int16_t
*
p_buffer
=
(
int16_t
*
)
p_aout_buf
->
p_buffer
;
int
i_nb_samples
=
p_aout_buf
->
i_nb_samples
;
int
i_nb_samples
=
p_aout_buf
->
i_nb_samples
;
block_t
*
p_chain
=
NULL
;
p_sys
->
i_pts
=
p_aout_buf
->
i_pts
-
p_sys
->
i_pts
=
p_aout_buf
->
i_pts
-
(
mtime_t
)
1000000
*
(
mtime_t
)
p_sys
->
i_nb_samples
/
(
mtime_t
)
1000000
*
(
mtime_t
)
p_sys
->
i_nb_samples
/
...
...
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