Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
9e6e2eeb
Commit
9e6e2eeb
authored
Feb 08, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly flush video/audio decoder in all cases.
parent
0e420aff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
src/input/decoder.c
src/input/decoder.c
+31
-8
No files found.
src/input/decoder.c
View file @
9e6e2eeb
...
...
@@ -888,10 +888,23 @@ static void *DecoderThread( vlc_object_t *p_this )
return
NULL
;
}
static
block_t
*
DecoderBlockFlushNew
()
{
block_t
*
p_null
=
block_Alloc
(
128
);
if
(
!
p_null
)
return
NULL
;
p_null
->
i_flags
|=
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
|
BLOCK_FLAG_CORE_FLUSH
;
memset
(
p_null
->
p_buffer
,
0
,
p_null
->
i_buffer
);
return
p_null
;
}
static
void
DecoderFlush
(
decoder_t
*
p_dec
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
block_t
*
p_null
;
vlc_assert_locked
(
&
p_owner
->
lock
);
...
...
@@ -903,15 +916,9 @@ static void DecoderFlush( decoder_t *p_dec )
vlc_cond_signal
(
&
p_owner
->
wait
);
/* Send a special block */
p_null
=
block_New
(
p_dec
,
128
);
block_t
*
p_null
=
DecoderBlockFlushNew
(
);
if
(
!
p_null
)
return
;
p_null
->
i_flags
|=
BLOCK_FLAG_DISCONTINUITY
;
p_null
->
i_flags
|=
BLOCK_FLAG_CORE_FLUSH
;
if
(
!
p_dec
->
fmt_in
.
b_packetized
)
p_null
->
i_flags
|=
BLOCK_FLAG_CORRUPTED
;
memset
(
p_null
->
p_buffer
,
0
,
p_null
->
i_buffer
);
input_DecoderDecode
(
p_dec
,
p_null
);
/* */
...
...
@@ -1796,6 +1803,14 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block, bool b_flus
p_packetized_block
=
p_next
;
}
}
/* The packetizer does not output a block that tell the decoder to flush
* do it ourself */
if
(
b_flush
)
{
block_t
*
p_null
=
DecoderBlockFlushNew
();
if
(
p_null
)
DecoderDecodeVideo
(
p_dec
,
p_null
);
}
}
else
if
(
p_block
)
{
...
...
@@ -1836,6 +1851,14 @@ static void DecoderProcessAudio( decoder_t *p_dec, block_t *p_block, bool b_flus
p_packetized_block
=
p_next
;
}
}
/* The packetizer does not output a block that tell the decoder to flush
* do it ourself */
if
(
b_flush
)
{
block_t
*
p_null
=
DecoderBlockFlushNew
();
if
(
p_null
)
DecoderDecodeAudio
(
p_dec
,
p_null
);
}
}
else
if
(
p_block
)
{
...
...
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