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
2237ed70
Commit
2237ed70
authored
Oct 20, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: factor init code for demux infos
This shares the code between access_demux and demux cases.
parent
a2beb67e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
77 deletions
+48
-77
src/input/input.c
src/input/input.c
+48
-77
No files found.
src/input/input.c
View file @
2237ed70
...
...
@@ -2179,44 +2179,8 @@ static int InputSourceInit( input_thread_t *p_input,
msg_Dbg
(
p_input
,
"trying to pre-parse %s"
,
psz_path
);
}
mtime_t
i_pts_delay
;
if
(
in
->
p_demux
)
{
/* Get infos from access_demux */
in
->
b_title_demux
=
true
;
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_GET_TITLE_INFO
,
&
in
->
title
,
&
in
->
i_title
,
&
in
->
i_title_offset
,
&
in
->
i_seekpoint_offset
)
)
{
TAB_INIT
(
in
->
i_title
,
in
->
title
);
}
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_CONTROL_PACE
,
&
in
->
b_can_pace_control
)
)
in
->
b_can_pace_control
=
false
;
assert
(
in
->
p_demux
->
pf_demux
!=
NULL
||
!
in
->
b_can_pace_control
);
if
(
!
in
->
b_can_pace_control
)
{
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_CONTROL_RATE
,
&
in
->
b_can_rate_control
,
&
in
->
b_rescale_ts
)
)
{
in
->
b_can_rate_control
=
false
;
in
->
b_rescale_ts
=
true
;
/* not used */
}
}
else
{
in
->
b_can_rate_control
=
true
;
in
->
b_rescale_ts
=
true
;
}
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_PAUSE
,
&
in
->
b_can_pause
)
)
in
->
b_can_pause
=
false
;
var_SetBool
(
p_input
,
"can-pause"
,
in
->
b_can_pause
||
!
in
->
b_can_pace_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rate"
,
!
in
->
b_can_pace_control
||
in
->
b_can_rate_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rewind"
,
!
in
->
b_rescale_ts
&&
!
in
->
b_can_pace_control
&&
in
->
b_can_rate_control
);
}
else
{
/* Now try a real access */
...
...
@@ -2305,26 +2269,6 @@ static int InputSourceInit( input_thread_t *p_input,
if
(
var_GetBool
(
p_input
,
"input-record-native"
)
)
p_stream
=
stream_FilterChainNew
(
p_stream
,
"record"
);
if
(
!
p_input
->
b_preparsing
)
{
stream_Control
(
p_stream
,
STREAM_CAN_CONTROL_PACE
,
&
in
->
b_can_pace_control
);
in
->
b_can_rate_control
=
in
->
b_can_pace_control
;
in
->
b_rescale_ts
=
true
;
stream_Control
(
p_stream
,
STREAM_CAN_PAUSE
,
&
in
->
b_can_pause
);
var_SetBool
(
p_input
,
"can-pause"
,
in
->
b_can_pause
||
!
in
->
b_can_pace_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rate"
,
!
in
->
b_can_pace_control
||
in
->
b_can_rate_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rewind"
,
!
in
->
b_rescale_ts
&&
!
in
->
b_can_pace_control
);
in
->
b_title_demux
=
false
;
stream_Control
(
p_stream
,
STREAM_GET_PTS_DELAY
,
&
i_pts_delay
);
}
if
(
p_stream
->
psz_url
!=
NULL
)
/* Take access/stream redirections into account: */
psz_path
=
strstr
(
p_stream
->
psz_url
,
"://"
);
...
...
@@ -2349,31 +2293,52 @@ static int InputSourceInit( input_thread_t *p_input,
goto
error
;
}
assert
(
in
->
p_demux
->
pf_demux
!=
NULL
);
/* Get title from demux */
if
(
!
p_input
->
b_preparsing
&&
in
->
i_title
<=
0
)
{
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_GET_TITLE_INFO
,
&
in
->
title
,
&
in
->
i_title
,
&
in
->
i_title_offset
,
&
in
->
i_seekpoint_offset
))
{
TAB_INIT
(
in
->
i_title
,
in
->
title
);
}
else
{
in
->
b_title_demux
=
true
;
}
}
}
free
(
psz_var_demux
);
free
(
psz_dup
);
/* Get infos from (access_)demux */
bool
b_can_seek
;
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_SEEK
,
&
b_can_seek
)
)
b_can_seek
=
false
;
var_SetBool
(
p_input
,
"can-seek"
,
b_can_seek
);
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_CONTROL_PACE
,
&
in
->
b_can_pace_control
)
)
in
->
b_can_pace_control
=
false
;
assert
(
in
->
p_demux
->
pf_demux
!=
NULL
||
!
in
->
b_can_pace_control
);
if
(
in
->
p_demux
->
s
!=
NULL
)
{
if
(
!
in
->
b_can_pace_control
)
{
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_CONTROL_RATE
,
&
in
->
b_can_rate_control
,
&
in
->
b_rescale_ts
)
)
{
in
->
b_can_rate_control
=
false
;
in
->
b_rescale_ts
=
true
;
/* not used */
}
}
else
{
in
->
b_can_rate_control
=
true
;
in
->
b_rescale_ts
=
true
;
}
}
else
{
in
->
b_can_rate_control
=
in
->
b_can_pace_control
;
in
->
b_rescale_ts
=
true
;
}
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_PAUSE
,
&
in
->
b_can_pause
);
var_SetBool
(
p_input
,
"can-pause"
,
in
->
b_can_pause
||
!
in
->
b_can_pace_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rate"
,
!
in
->
b_can_pace_control
||
in
->
b_can_rate_control
);
/* XXX temporary because of es_out_timeshift*/
var_SetBool
(
p_input
,
"can-rewind"
,
!
in
->
b_rescale_ts
&&
!
in
->
b_can_pace_control
&&
in
->
b_can_rate_control
);
/* Set record capabilities */
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_CAN_RECORD
,
&
in
->
b_can_stream_record
)
)
in
->
b_can_stream_record
=
false
;
...
...
@@ -2389,6 +2354,17 @@ static int InputSourceInit( input_thread_t *p_input,
* FIXME improve for b_preparsing: move it after GET_META and check psz_arturl */
if
(
!
p_input
->
b_preparsing
)
{
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_GET_TITLE_INFO
,
&
in
->
title
,
&
in
->
i_title
,
&
in
->
i_title_offset
,
&
in
->
i_seekpoint_offset
))
{
TAB_INIT
(
in
->
i_title
,
in
->
title
);
}
else
{
in
->
b_title_demux
=
true
;
}
int
i_attachment
;
input_attachment_t
**
attachment
;
if
(
!
demux_Control
(
in
->
p_demux
,
DEMUX_GET_ATTACHMENTS
,
...
...
@@ -2400,12 +2376,7 @@ static int InputSourceInit( input_thread_t *p_input,
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
}
/* PTS delay: request from demux first. This is required for
* access_demux and some special cases like SDP demux. Otherwise,
* fallback to access */
if
(
demux_Control
(
in
->
p_demux
,
DEMUX_GET_PTS_DELAY
,
&
in
->
i_pts_delay
)
)
in
->
i_pts_delay
=
i_pts_delay
;
demux_Control
(
in
->
p_demux
,
DEMUX_GET_PTS_DELAY
,
&
in
->
i_pts_delay
);
if
(
in
->
i_pts_delay
>
INPUT_PTS_DELAY_MAX
)
in
->
i_pts_delay
=
INPUT_PTS_DELAY_MAX
;
else
if
(
in
->
i_pts_delay
<
0
)
...
...
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