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
e916edc9
Commit
e916edc9
authored
Feb 17, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed one malloc per new playlist item (qt4).
parent
3fae03b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+3
-5
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+12
-6
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
e916edc9
...
...
@@ -521,7 +521,7 @@ void PLModel::customEvent( QEvent *event )
if
(
type
==
ItemUpdate_Type
)
ProcessInputItemUpdate
(
ple
->
i_id
);
else
if
(
type
==
ItemAppend_Type
)
ProcessItemAppend
(
ple
->
p_
add
);
ProcessItemAppend
(
&
ple
->
add
);
else
if
(
type
==
ItemDelete_Type
)
ProcessItemRemoval
(
ple
->
i_id
);
else
...
...
@@ -550,7 +550,7 @@ void PLModel::ProcessItemRemoval( int i_id )
removeItem
(
i_id
);
}
void
PLModel
::
ProcessItemAppend
(
playlist_add_t
*
p_add
)
void
PLModel
::
ProcessItemAppend
(
const
playlist_add_t
*
p_add
)
{
playlist_item_t
*
p_item
=
NULL
;
PLItem
*
newItem
=
NULL
;
...
...
@@ -977,9 +977,7 @@ static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t
oval
,
vlc_value_t
nval
,
void
*
param
)
{
PLModel
*
p_model
=
(
PLModel
*
)
param
;
playlist_add_t
*
p_add
=
(
playlist_add_t
*
)
malloc
(
sizeof
(
playlist_add_t
));
memcpy
(
p_add
,
nval
.
p_address
,
sizeof
(
playlist_add_t
)
);
const
playlist_add_t
*
p_add
=
(
playlist_add_t
*
)
nval
.
p_address
;
PLEvent
*
event
=
new
PLEvent
(
p_add
);
QApplication
::
postEvent
(
p_model
,
event
);
return
VLC_SUCCESS
;
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
e916edc9
...
...
@@ -61,15 +61,21 @@ class PLEvent : public QEvent
{
public:
PLEvent
(
int
type
,
int
id
)
:
QEvent
(
(
QEvent
::
Type
)(
type
)
)
{
i_id
=
id
;
p_add
=
NULL
;
};
{
i_id
=
id
;
add
.
i_node
=
-
1
;
add
.
i_item
=
-
1
;
};
PLEvent
(
playlist_add_t
*
a
)
:
QEvent
(
(
QEvent
::
Type
)(
ItemAppend_Type
)
)
{
p_add
=
a
;
};
PLEvent
(
const
playlist_add_t
*
a
)
:
QEvent
(
(
QEvent
::
Type
)(
ItemAppend_Type
)
)
{
add
=
*
a
;
};
virtual
~
PLEvent
()
{
free
(
p_add
);
};
virtual
~
PLEvent
()
{
};
int
i_id
;
playlist_add_t
*
p_
add
;
playlist_add_t
add
;
};
...
...
@@ -136,7 +142,7 @@ private:
/* Update processing */
void
ProcessInputItemUpdate
(
int
i_input_id
);
void
ProcessItemRemoval
(
int
i_id
);
void
ProcessItemAppend
(
playlist_add_t
*
p_add
);
void
ProcessItemAppend
(
const
playlist_add_t
*
p_add
);
void
UpdateTreeItem
(
PLItem
*
,
bool
,
bool
force
=
false
);
void
UpdateTreeItem
(
playlist_item_t
*
,
PLItem
*
,
bool
,
bool
forc
=
false
);
...
...
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