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
719d408b
Commit
719d408b
authored
Nov 02, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the need of input_EsOutGetFromID.
parent
a03e58ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
29 deletions
+45
-29
src/input/es_out.c
src/input/es_out.c
+36
-17
src/input/es_out.h
src/input/es_out.h
+4
-1
src/input/input.c
src/input/input.c
+5
-11
No files found.
src/input/es_out.c
View file @
719d408b
...
...
@@ -310,23 +310,6 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
return
out
;
}
es_out_id_t
*
input_EsOutGetFromID
(
es_out_t
*
out
,
int
i_id
)
{
int
i
;
if
(
i_id
<
0
)
{
/* Special HACK, -i_id is the cat of the stream */
return
(
es_out_id_t
*
)((
uint8_t
*
)
NULL
-
i_id
);
}
for
(
i
=
0
;
i
<
out
->
p_sys
->
i_es
;
i
++
)
{
if
(
out
->
p_sys
->
es
[
i
]
->
i_id
==
i_id
)
return
out
->
p_sys
->
es
[
i
];
}
return
NULL
;
}
void
input_EsOutChangeRate
(
es_out_t
*
out
,
int
i_rate
)
{
es_out_sys_t
*
p_sys
=
out
->
p_sys
;
...
...
@@ -670,6 +653,22 @@ static mtime_t EsOutGetWakeup( es_out_t *out )
return
input_clock_GetWakeup
(
p_sys
->
p_pgrm
->
p_clock
);
}
static
es_out_id_t
*
EsOutGetFromID
(
es_out_t
*
out
,
int
i_id
)
{
int
i
;
if
(
i_id
<
0
)
{
/* Special HACK, -i_id is the cat of the stream */
return
(
es_out_id_t
*
)((
uint8_t
*
)
NULL
-
i_id
);
}
for
(
i
=
0
;
i
<
out
->
p_sys
->
i_es
;
i
++
)
{
if
(
out
->
p_sys
->
es
[
i
]
->
i_id
==
i_id
)
return
out
->
p_sys
->
es
[
i
];
}
return
NULL
;
}
static
void
EsOutDecodersStopBuffering
(
es_out_t
*
out
,
bool
b_forced
)
{
...
...
@@ -2290,6 +2289,26 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
return
VLC_SUCCESS
;
}
case
ES_OUT_SET_ES_BY_ID
:
case
ES_OUT_RESTART_ES_BY_ID
:
case
ES_OUT_SET_ES_DEFAULT_BY_ID
:
{
const
int
i_id
=
(
int
)
va_arg
(
args
,
int
);
es_out_id_t
*
p_es
=
EsOutGetFromID
(
out
,
i_id
);
int
i_new_query
;
switch
(
i_query
)
{
case
ES_OUT_SET_ES_BY_ID
:
i_new_query
=
ES_OUT_SET_ES
;
break
;
case
ES_OUT_RESTART_ES_BY_ID
:
i_new_query
=
ES_OUT_RESTART_ES
;
break
;
case
ES_OUT_SET_ES_DEFAULT_BY_ID
:
i_new_query
=
ES_OUT_SET_ES_DEFAULT
;
break
;
default:
assert
(
0
);
}
/* TODO if the lock is made non recursive it should be changed */
return
es_out_Control
(
out
,
i_new_query
,
p_es
);
}
default:
msg_Err
(
p_sys
->
p_input
,
"unknown query in es_out_Control"
);
return
VLC_EGENERIC
;
...
...
src/input/es_out.h
View file @
719d408b
...
...
@@ -36,6 +36,10 @@ enum es_out_query_private_e
/* Get date to wait before demuxing more data */
ES_OUT_GET_WAKE_UP
=
ES_OUT_PRIVATE_START
,
/* arg1=mtime_t* res=cannot fail */
/* Wrapper for some ES command to work with id */
ES_OUT_SET_ES_BY_ID
,
ES_OUT_RESTART_ES_BY_ID
,
ES_OUT_SET_ES_DEFAULT_BY_ID
,
};
static
inline
mtime_t
es_out_GetWakeup
(
es_out_t
*
p_out
)
...
...
@@ -49,7 +53,6 @@ static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
es_out_t
*
input_EsOutNew
(
input_thread_t
*
,
int
i_rate
);
es_out_id_t
*
input_EsOutGetFromID
(
es_out_t
*
,
int
i_id
);
void
input_EsOutSetDelay
(
es_out_t
*
,
int
i_cat
,
int64_t
);
int
input_EsOutSetRecord
(
es_out_t
*
,
bool
b_record
);
void
input_EsOutChangeRate
(
es_out_t
*
,
int
);
...
...
src/input/input.c
View file @
719d408b
...
...
@@ -1811,13 +1811,11 @@ static bool Control( input_thread_t *p_input, int i_type,
case
INPUT_CONTROL_SET_ES
:
/* No need to force update, es_out does it if needed */
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES
,
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
val
.
i_int
)
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES_BY_ID
,
val
.
i_int
);
break
;
case
INPUT_CONTROL_RESTART_ES
:
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_RESTART_ES
,
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
val
.
i_int
)
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_RESTART_ES_BY_ID
,
val
.
i_int
);
break
;
case
INPUT_CONTROL_SET_AUDIO_DELAY
:
...
...
@@ -3107,14 +3105,10 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for
if
(
count
.
i_int
<
list
.
p_list
->
i_count
)
{
int
i_id
=
list
.
p_list
->
p_values
[
count
.
i_int
].
i_int
;
const
int
i_id
=
list
.
p_list
->
p_values
[
count
.
i_int
].
i_int
;
input_EsOutLock
(
p_input
->
p
->
p_es_out
);
es_out_id_t
*
p_es
=
input_EsOutGetFromID
(
p_input
->
p
->
p_es_out
,
i_id
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES_DEFAULT
,
p_es
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES
,
p_es
);
input_EsOutUnlock
(
p_input
->
p
->
p_es_out
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES_DEFAULT_BY_ID
,
i_id
);
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_SET_ES_BY_ID
,
i_id
);
}
var_Change
(
p_input
,
"spu-es"
,
VLC_VAR_FREELIST
,
&
list
,
NULL
);
}
...
...
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