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
6e89372e
Commit
6e89372e
authored
Sep 07, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: restart module if fmt_in is changed by the packetizer
parent
2a278dfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
20 deletions
+26
-20
src/input/decoder.c
src/input/decoder.c
+26
-20
No files found.
src/input/decoder.c
View file @
6e89372e
...
...
@@ -1052,24 +1052,20 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block, bool b_flus
while
(
(
p_packetized_block
=
p_packetizer
->
pf_packetize
(
p_packetizer
,
p_block
?
&
p_block
:
NULL
))
)
{
if
(
p_packetizer
->
fmt_out
.
i_extra
&&
!
p_dec
->
fmt_in
.
i_extra
)
if
(
!
es_format_IsSimilar
(
&
p_dec
->
fmt_in
,
&
p_packetizer
->
fmt_out
)
)
{
es_format_Clean
(
&
p_dec
->
fmt_in
);
es_format_Copy
(
&
p_dec
->
fmt_in
,
&
p_packetizer
->
fmt_out
);
}
/* If the packetizer provides aspect ratio information, pass it
* to the decoder as a hint if the decoder itself can't provide
* it. Copy it regardless of the current value of the decoder input
* format aspect ratio, to properly propagate changes in aspect
* ratio. */
if
(
p_packetizer
->
fmt_out
.
video
.
i_sar_num
>
0
&&
p_packetizer
->
fmt_out
.
video
.
i_sar_den
>
0
)
{
p_dec
->
fmt_in
.
video
.
i_sar_num
=
p_packetizer
->
fmt_out
.
video
.
i_sar_num
;
p_dec
->
fmt_in
.
video
.
i_sar_den
=
p_packetizer
->
fmt_out
.
video
.
i_sar_den
;
msg_Dbg
(
p_dec
,
"restarting module due to input format change"
);
/* Drain the decoder module */
DecoderDecodeVideo
(
p_dec
,
NULL
);
/* Restart the decoder module */
UnloadDecoder
(
p_dec
);
if
(
LoadDecoder
(
p_dec
,
false
,
&
p_packetizer
->
fmt_out
)
)
{
p_dec
->
b_error
=
true
;
block_ChainRelease
(
p_packetized_block
);
return
;
}
}
if
(
p_packetizer
->
pf_get_cc
)
...
...
@@ -1232,10 +1228,20 @@ static void DecoderProcessAudio( decoder_t *p_dec, block_t *p_block, bool b_flus
while
(
(
p_packetized_block
=
p_packetizer
->
pf_packetize
(
p_packetizer
,
p_block
?
&
p_block
:
NULL
))
)
{
if
(
p_packetizer
->
fmt_out
.
i_extra
&&
!
p_dec
->
fmt_in
.
i_extra
)
if
(
!
es_format_IsSimilar
(
&
p_dec
->
fmt_in
,
&
p_packetizer
->
fmt_out
)
)
{
es_format_Clean
(
&
p_dec
->
fmt_in
);
es_format_Copy
(
&
p_dec
->
fmt_in
,
&
p_packetizer
->
fmt_out
);
msg_Dbg
(
p_dec
,
"restarting module due to input format change"
);
/* Drain the decoder module */
DecoderDecodeAudio
(
p_dec
,
NULL
);
/* Restart the decoder module */
UnloadDecoder
(
p_dec
);
if
(
LoadDecoder
(
p_dec
,
false
,
&
p_packetizer
->
fmt_out
)
)
{
p_dec
->
b_error
=
true
;
block_ChainRelease
(
p_packetized_block
);
return
;
}
}
while
(
p_packetized_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