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
3be0dbaf
Commit
3be0dbaf
authored
Aug 24, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: merge both private format structures
parent
f4f5aee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
src/input/decoder.c
src/input/decoder.c
+22
-21
No files found.
src/input/decoder.c
View file @
3be0dbaf
...
...
@@ -101,7 +101,6 @@ struct decoder_owner_sys_t
/* */
bool
b_fmt_description
;
es_format_t
fmt_description
;
vlc_meta_t
*
p_description
;
/* fifo */
...
...
@@ -611,8 +610,8 @@ bool input_DecoderHasFormatChanged( decoder_t *p_dec, es_format_t *p_fmt, vlc_me
b_changed
=
p_owner
->
b_fmt_description
;
if
(
b_changed
)
{
if
(
p_fmt
)
es_format_Copy
(
p_fmt
,
&
p_owner
->
fmt
_description
);
if
(
p_fmt
!=
NULL
)
es_format_Copy
(
p_fmt
,
&
p_owner
->
fmt
);
if
(
pp_meta
)
{
...
...
@@ -849,7 +848,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
vlc_cond_init
(
&
p_owner
->
wait_acknowledge
);
p_owner
->
b_fmt_description
=
false
;
es_format_Init
(
&
p_owner
->
fmt_description
,
UNKNOWN_ES
,
0
);
p_owner
->
p_description
=
NULL
;
p_owner
->
b_exit
=
false
;
...
...
@@ -1510,6 +1508,7 @@ static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block )
{
if
(
p_owner
->
p_sout_input
==
NULL
)
{
assert
(
!
p_owner
->
b_fmt_description
);
// no need for owner lock
es_format_Clean
(
&
p_owner
->
fmt
);
es_format_Copy
(
&
p_owner
->
fmt
,
&
p_dec
->
fmt_out
);
...
...
@@ -1879,7 +1878,6 @@ static void DeleteDecoder( decoder_t * p_dec )
es_format_Clean
(
&
p_dec
->
fmt_out
);
if
(
p_dec
->
p_description
)
vlc_meta_Delete
(
p_dec
->
p_description
);
es_format_Clean
(
&
p_owner
->
fmt_description
);
if
(
p_owner
->
p_description
)
vlc_meta_Delete
(
p_owner
->
p_description
);
...
...
@@ -1914,10 +1912,6 @@ static void DecoderUpdateFormatLocked( decoder_t *p_dec )
p_owner
->
b_fmt_description
=
true
;
/* Copy es_format */
es_format_Clean
(
&
p_owner
->
fmt_description
);
es_format_Copy
(
&
p_owner
->
fmt_description
,
&
p_dec
->
fmt_out
);
/* Move p_description */
if
(
p_owner
->
p_description
&&
p_dec
->
p_description
)
vlc_meta_Delete
(
p_owner
->
p_description
);
...
...
@@ -1960,16 +1954,12 @@ static int aout_update_format( decoder_t *p_dec )
if
(
p_owner
->
p_aout
==
NULL
)
{
const
int
i_force_dolby
=
var_InheritInteger
(
p_dec
,
"force-dolby-surround"
);
audio_sample_format_t
format
;
audio_output_t
*
p_aout
;
aout_request_vout_t
request_vout
;
p_dec
->
fmt_out
.
audio
.
i_format
=
p_dec
->
fmt_out
.
i_codec
;
p_owner
->
fmt
.
audio
=
p_dec
->
fmt_out
.
audio
;
aout_FormatPrepare
(
&
p_owner
->
fmt
.
audio
);
format
=
p_owner
->
fmt
.
audio
;
audio_sample_format_t
format
=
p_dec
->
fmt_out
.
audio
;
aout_FormatPrepare
(
&
format
);
const
int
i_force_dolby
=
var_InheritInteger
(
p_dec
,
"force-dolby-surround"
);
if
(
i_force_dolby
&&
(
format
.
i_original_channels
&
AOUT_CHAN_PHYSMASK
)
==
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
)
...
...
@@ -1986,10 +1976,12 @@ static int aout_update_format( decoder_t *p_dec )
}
}
request_vout
.
pf_request_vout
=
aout_request_vout
;
request_vout
.
p_private
=
p_dec
;
aout_request_vout_t
request_vout
=
{
.
pf_request_vout
=
aout_request_vout
,
.
p_private
=
p_dec
,
};
audio_output_t
*
p_aout
;
assert
(
p_owner
->
p_aout
==
NULL
);
p_aout
=
input_resource_GetAout
(
p_owner
->
p_resource
);
if
(
p_aout
)
{
...
...
@@ -2005,7 +1997,13 @@ static int aout_update_format( decoder_t *p_dec )
vlc_mutex_lock
(
&
p_owner
->
lock
);
p_owner
->
p_aout
=
p_aout
;
es_format_Clean
(
&
p_owner
->
fmt
);
es_format_Copy
(
&
p_owner
->
fmt
,
&
p_dec
->
fmt_out
);
aout_FormatPrepare
(
&
p_owner
->
fmt
.
audio
);
DecoderUpdateFormatLocked
(
p_dec
);
if
(
unlikely
(
p_owner
->
b_paused
)
)
/* fake pause if needed */
aout_DecChangePause
(
p_aout
,
true
,
mdate
()
);
...
...
@@ -2056,7 +2054,6 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
video_format_t
fmt
=
p_dec
->
fmt_out
.
video
;
fmt
.
i_chroma
=
p_dec
->
fmt_out
.
i_codec
;
p_owner
->
fmt
.
video
=
fmt
;
if
(
vlc_fourcc_IsYUV
(
fmt
.
i_chroma
)
)
{
...
...
@@ -2142,6 +2139,10 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
vlc_mutex_lock
(
&
p_owner
->
lock
);
p_owner
->
p_vout
=
p_vout
;
es_format_Clean
(
&
p_owner
->
fmt
);
es_format_Copy
(
&
p_owner
->
fmt
,
&
p_dec
->
fmt_out
);
p_owner
->
fmt
.
video
.
i_chroma
=
p_dec
->
fmt_out
.
i_codec
;
DecoderUpdateFormatLocked
(
p_dec
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
...
...
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