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
c00b6cab
Commit
c00b6cab
authored
Feb 01, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interaction: avoid thread if there is no provider
parent
dd0ad6e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
34 deletions
+19
-34
include/vlc_interface.h
include/vlc_interface.h
+1
-0
src/interface/interaction.c
src/interface/interaction.c
+18
-34
No files found.
include/vlc_interface.h
View file @
c00b6cab
...
...
@@ -224,6 +224,7 @@ struct interaction_dialog_t
interaction_t
*
p_interaction
;
///< Parent interaction object
vlc_object_t
*
p_parent
;
///< The vlc object that asked
//for interaction
intf_thread_t
*
p_interface
;
};
/**
...
...
src/interface/interaction.c
View file @
c00b6cab
...
...
@@ -476,16 +476,27 @@ static void DialogDestroy( interaction_dialog_t *p_dialog )
* if required */
static
int
DialogSend
(
vlc_object_t
*
p_this
,
interaction_dialog_t
*
p_dialog
)
{
interaction_t
*
p_interaction
=
InteractionGet
(
p_dialog
->
p_parent
);
interaction_t
*
p_interaction
;
intf_thread_t
*
p_intf
;
if
(
p_this
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
return
VLC_EGENERIC
;
p_interaction
=
InteractionGet
(
p_dialog
->
p_parent
);
if
(
!
p_interaction
)
return
VLC_EGENERIC
;
if
(
p_this
->
i_flags
&
OBJECT_FLAGS_NOINTERACT
)
p_intf
=
SearchInterface
(
p_interaction
);
if
(
p_intf
==
NULL
)
{
p_dialog
->
i_return
=
DIALOG_DEFAULT
;
/* Give default answer */
/* Pretend we have hidden and destroyed it */
p_dialog
->
i_status
=
HIDING_DIALOG
;
vlc_object_release
(
p_interaction
);
return
VLC_
EGENERIC
;
return
VLC_
SUCCESS
;
}
p_dialog
->
p_interface
=
p_intf
;
if
(
config_GetInt
(
p_this
,
"interact"
)
||
p_dialog
->
i_flags
&
DIALOG_BLOCKING_ERROR
||
...
...
@@ -585,26 +596,6 @@ static void InteractionManage( interaction_t *p_interaction )
vlc_value_t
val
;
int
i_index
;
/* Nothing to do */
if
(
p_interaction
->
i_dialogs
==
0
)
return
;
p_interaction
->
p_intf
=
SearchInterface
(
p_interaction
);
if
(
!
p_interaction
->
p_intf
)
{
/* We mark all dialogs as answered with their "default" answer */
for
(
i_index
=
0
;
i_index
<
p_interaction
->
i_dialogs
;
i_index
++
)
{
interaction_dialog_t
*
p_dialog
=
p_interaction
->
pp_dialogs
[
i_index
];
p_dialog
->
i_return
=
DIALOG_DEFAULT
;
/* Give default answer */
/* Pretend we have hidden and destroyed it */
if
(
p_dialog
->
i_status
==
HIDDEN_DIALOG
)
p_dialog
->
i_status
=
DESTROYED_DIALOG
;
else
p_dialog
->
i_status
=
HIDING_DIALOG
;
}
}
for
(
i_index
=
0
;
i_index
<
p_interaction
->
i_dialogs
;
i_index
++
)
{
interaction_dialog_t
*
p_dialog
=
p_interaction
->
pp_dialogs
[
i_index
];
...
...
@@ -614,23 +605,20 @@ static void InteractionManage( interaction_t *p_interaction )
/* Ask interface to hide it */
p_dialog
->
i_action
=
INTERACT_HIDE
;
val
.
p_address
=
p_dialog
;
if
(
p_interaction
->
p_intf
)
var_Set
(
p_interaction
->
p_intf
,
"interaction"
,
val
);
var_Set
(
p_dialog
->
p_interface
,
"interaction"
,
val
);
p_dialog
->
i_status
=
HIDING_DIALOG
;
break
;
case
UPDATED_DIALOG
:
p_dialog
->
i_action
=
INTERACT_UPDATE
;
val
.
p_address
=
p_dialog
;
if
(
p_interaction
->
p_intf
)
var_Set
(
p_interaction
->
p_intf
,
"interaction"
,
val
);
var_Set
(
p_dialog
->
p_interface
,
"interaction"
,
val
);
p_dialog
->
i_status
=
SENT_DIALOG
;
break
;
case
HIDDEN_DIALOG
:
if
(
!
(
p_dialog
->
i_flags
&
DIALOG_GOT_ANSWER
)
)
break
;
p_dialog
->
i_action
=
INTERACT_DESTROY
;
val
.
p_address
=
p_dialog
;
if
(
p_interaction
->
p_intf
)
var_Set
(
p_interaction
->
p_intf
,
"interaction"
,
val
);
var_Set
(
p_dialog
->
p_interface
,
"interaction"
,
val
);
break
;
case
DESTROYED_DIALOG
:
/* Interface has now destroyed it, remove it */
...
...
@@ -644,13 +632,9 @@ static void InteractionManage( interaction_t *p_interaction )
p_dialog
->
i_action
=
INTERACT_NEW
;
val
.
p_address
=
p_dialog
;
if
(
p_interaction
->
p_intf
)
var_Set
(
p_interaction
->
p_intf
,
"interaction"
,
val
);
var_Set
(
p_dialog
->
p_interface
,
"interaction"
,
val
);
p_dialog
->
i_status
=
SENT_DIALOG
;
break
;
}
}
if
(
p_interaction
->
p_intf
)
vlc_object_release
(
p_interaction
->
p_intf
);
}
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