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
6bbc4b99
Commit
6bbc4b99
authored
May 16, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass pointer rather than ID for playlist item-current
parent
b9a26cf1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
14 deletions
+38
-14
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+16
-7
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+5
-1
modules/misc/lua/libs/playlist.c
modules/misc/lua/libs/playlist.c
+13
-1
modules/misc/notify/telepathy.c
modules/misc/notify/telepathy.c
+2
-2
src/playlist/engine.c
src/playlist/engine.c
+1
-2
src/playlist/thread.c
src/playlist/thread.c
+1
-1
No files found.
modules/gui/qt4/input_manager.cpp
View file @
6bbc4b99
...
...
@@ -255,8 +255,9 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
input_item_t
*
p_item
=
static_cast
<
input_item_t
*>
(
newval
.
p_address
);
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
newval
.
i_int
);
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
p_item
->
i_id
);
QApplication
::
postEvent
(
im
,
event
);
return
VLC_SUCCESS
;
}
...
...
@@ -884,10 +885,18 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
im
,
setInput
(
input_thread_t
*
)
);
/* emit check if playlist has already started playing */
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
var_GetInteger
(
THEPL
,
"item-current"
)
);
customEvent
(
event
);
delete
event
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
THEPL
);
if
(
p_input
)
{
input_item_t
*
p_item
=
input_GetItem
(
p_input
);
if
(
p_item
)
{
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
p_item
->
i_id
);
customEvent
(
event
);
delete
event
;
}
vlc_object_release
(
p_input
);
}
}
MainInputManager
::~
MainInputManager
()
...
...
@@ -1003,11 +1012,11 @@ void MainInputManager::activatePlayQuit( bool b_exit )
/* Static callbacks for MIM */
static
int
PLItemChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
vlc_value_t
oldval
,
vlc_value_t
,
void
*
param
)
{
MainInputManager
*
mim
=
(
MainInputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
newval
.
i_int
);
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
0
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
6bbc4b99
...
...
@@ -479,6 +479,7 @@ int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
void
*
pParam
)
{
VlcProc
*
pThis
=
(
VlcProc
*
)
pParam
;
input_item_t
*
p_item
=
newval
.
p_address
;
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
...
...
@@ -486,10 +487,13 @@ int VlcProc::onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
pThis
->
updateStreamName
();
// Create two playtree notify commands: one for old item, one for new
#if 0 /* FIXME: Heck, no! You cannot do that.
There is no warranty that the old item is still valid. */
CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
oldVal.i_int );
pQueue->push( CmdGenericPtr( pCmdTree ) , true );
pCmdTree
=
new
CmdPlaytreeUpdate
(
pThis
->
getIntf
(),
newVal
.
i_int
);
#endif
pCmdTree
=
new
CmdPlaytreeUpdate
(
pThis
->
getIntf
(),
p_item
->
i_id
);
pQueue
->
push
(
CmdGenericPtr
(
pCmdTree
)
,
true
);
return
VLC_SUCCESS
;
...
...
modules/misc/lua/libs/playlist.c
View file @
6bbc4b99
...
...
@@ -318,7 +318,19 @@ static int vlclua_playlist_search( lua_State *L )
static
int
vlclua_playlist_current
(
lua_State
*
L
)
{
playlist_t
*
p_playlist
=
vlclua_get_playlist_internal
(
L
);
lua_pushinteger
(
L
,
var_GetInteger
(
p_playlist
,
"item-current"
)
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
int
id
=
-
1
;
if
(
p_input
)
{
input_item_t
*
p_item
=
input_GetItem
(
p_input
);
if
(
p_item
)
id
=
p_item
->
i_id
;
vlc_object_release
(
p_input
);
}
#warning Indexing input items by ID is unsafe,
lua_pushinteger
(
L
,
id
);
vlclua_release_playlist_internal
(
p_playlist
);
return
1
;
}
...
...
modules/misc/notify/telepathy.c
View file @
6bbc4b99
...
...
@@ -173,17 +173,17 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
playlist_t
*
p_playlist
=
(
playlist_t
*
)
p_this
;
char
*
psz_buf
=
NULL
;
input_thread_t
*
p_input
;
input_item_t
*
p_item
=
newval
.
p_address
;
bool
b_is_item_current
=
!
strcmp
(
"item-current"
,
psz_var
);
/* Don't update Telepathy presence each time an item has been preparsed */
if
(
b_is_item_current
)
{
/* stores the current input item id */
p_intf
->
p_sys
->
i_id
=
newval
.
i_int
;
p_intf
->
p_sys
->
i_id
=
p_item
->
i_id
;
p_intf
->
p_sys
->
i_item_changes
=
0
;
}
else
{
input_item_t
*
p_item
=
newval
.
p_address
;
if
(
p_item
->
i_id
!=
p_intf
->
p_sys
->
i_id
)
/* "item-change" */
return
VLC_SUCCESS
;
...
...
src/playlist/engine.c
View file @
6bbc4b99
...
...
@@ -279,8 +279,7 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create
(
p_playlist
,
"playlist-item-append"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_playlist
,
"item-current"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_playlist
,
"item-current"
,
-
1
);
var_Create
(
p_playlist
,
"item-current"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_playlist
,
"activity"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_playlist
,
"activity"
,
0
);
...
...
src/playlist/thread.c
View file @
6bbc4b99
...
...
@@ -297,7 +297,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
}
PL_UNLOCK
;
var_Set
Integer
(
p_playlist
,
"item-current"
,
p_input
->
i_id
);
var_Set
Address
(
p_playlist
,
"item-current"
,
p_input
);
PL_LOCK
;
return
VLC_SUCCESS
;
...
...
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