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
319597fd
Commit
319597fd
authored
Oct 04, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbus: simplify playlist operations
parent
626e56bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
39 deletions
+8
-39
modules/control/dbus.c
modules/control/dbus.c
+8
-33
modules/control/dbus.h
modules/control/dbus.h
+0
-6
No files found.
modules/control/dbus.c
View file @
319597fd
...
@@ -357,10 +357,9 @@ DBUS_METHOD( GetMetadata )
...
@@ -357,10 +357,9 @@ DBUS_METHOD( GetMetadata )
DBusError
error
;
DBusError
error
;
dbus_error_init
(
&
error
);
dbus_error_init
(
&
error
);
dbus_int32_t
i_position
,
i_count
=
0
;
dbus_int32_t
i_position
;
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_item_t
*
p_tested_item
=
p_playlist
->
p_root_onelevel
;
dbus_message_get_args
(
p_from
,
&
error
,
dbus_message_get_args
(
p_from
,
&
error
,
DBUS_TYPE_INT32
,
&
i_position
,
DBUS_TYPE_INT32
,
&
i_position
,
...
@@ -374,15 +373,11 @@ DBUS_METHOD( GetMetadata )
...
@@ -374,15 +373,11 @@ DBUS_METHOD( GetMetadata )
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
}
while
(
p_tested_item
&&
(
i_count
<
i_position
)
)
if
(
i_position
<=
p_playlist
->
items
.
i_size
/
2
)
{
{
i_count
++
;
GetInputMeta
(
p_playlist
->
items
.
p_elems
[
i_position
*
2
-
1
]
->
p_input
,
&
args
);
TEST_NEXT_ITEM
;
}
}
if
(
p_tested_item
)
GetInputMeta
(
p_tested_item
->
p_input
,
&
args
);
pl_Release
(
p_playlist
);
pl_Release
(
p_playlist
);
REPLY_SEND
;
REPLY_SEND
;
}
}
...
@@ -392,19 +387,8 @@ DBUS_METHOD( GetLength )
...
@@ -392,19 +387,8 @@ DBUS_METHOD( GetLength )
REPLY_INIT
;
REPLY_INIT
;
OUT_ARGUMENTS
;
OUT_ARGUMENTS
;
dbus_int32_t
i_elements
=
0
;
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_item_t
*
p_tested_item
=
p_playlist
->
p_root_onelevel
;
dbus_int32_t
i_elements
=
p_playlist
->
items
.
i_size
/
2
;
playlist_item_t
*
p_last_item
=
playlist_GetLastLeaf
(
p_playlist
,
p_playlist
->
p_root_onelevel
);
while
(
p_tested_item
&&
(
p_tested_item
->
p_input
->
i_id
!=
p_last_item
->
p_input
->
i_id
)
)
{
i_elements
++
;
TEST_NEXT_ITEM
;
}
pl_Release
(
p_playlist
);
pl_Release
(
p_playlist
);
ADD_INT32
(
&
i_elements
);
ADD_INT32
(
&
i_elements
);
...
@@ -418,9 +402,8 @@ DBUS_METHOD( DelTrack )
...
@@ -418,9 +402,8 @@ DBUS_METHOD( DelTrack )
DBusError
error
;
DBusError
error
;
dbus_error_init
(
&
error
);
dbus_error_init
(
&
error
);
dbus_int32_t
i_position
,
i_count
=
0
;
dbus_int32_t
i_position
;
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_item_t
*
p_tested_item
=
p_playlist
->
p_root_onelevel
;
dbus_message_get_args
(
p_from
,
&
error
,
dbus_message_get_args
(
p_from
,
&
error
,
DBUS_TYPE_INT32
,
&
i_position
,
DBUS_TYPE_INT32
,
&
i_position
,
...
@@ -434,19 +417,11 @@ DBUS_METHOD( DelTrack )
...
@@ -434,19 +417,11 @@ DBUS_METHOD( DelTrack )
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
}
while
(
p_tested_item
&&
(
i_count
<
i_position
)
)
if
(
i_position
>=
p_playlist
->
items
.
i_size
/
2
)
{
i_count
++
;
TEST_NEXT_ITEM
;
}
if
(
p_tested_item
)
{
{
PL_LOCK
;
playlist_DeleteFromInput
(
p_playlist
,
playlist_DeleteFromInput
(
p_playlist
,
p_tested_item
->
p_input
->
i_id
,
p_playlist
->
items
.
p_elems
[
i_position
*
2
-
1
]
->
i_id
,
VLC_TRUE
);
VLC_FALSE
);
PL_UNLOCK
;
}
}
pl_Release
(
p_playlist
);
pl_Release
(
p_playlist
);
...
...
modules/control/dbus.h
View file @
319597fd
...
@@ -78,12 +78,6 @@
...
@@ -78,12 +78,6 @@
#define ADD_INT32( i ) DBUS_ADD( DBUS_TYPE_INT32, i )
#define ADD_INT32( i ) DBUS_ADD( DBUS_TYPE_INT32, i )
#define ADD_BYTE( b ) DBUS_ADD( DBUS_TYPE_BYTE, b )
#define ADD_BYTE( b ) DBUS_ADD( DBUS_TYPE_BYTE, b )
/* VLC related */
/* Don't forget to test p_tested_item for NULL on loops */
#define TEST_NEXT_ITEM \
p_tested_item = playlist_GetNextLeaf( p_playlist, \
p_playlist->p_root_onelevel, p_tested_item, VLC_FALSE, VLC_FALSE );
/* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */
/* XML data to answer org.freedesktop.DBus.Introspectable.Introspect requests */
const
char
*
psz_introspection_xml_data_root
=
const
char
*
psz_introspection_xml_data_root
=
...
...
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