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
0c86c2c9
Commit
0c86c2c9
authored
May 11, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allocate message item on the stack
parent
9fd97f34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
src/misc/messages.c
src/misc/messages.c
+18
-20
No files found.
src/misc/messages.c
View file @
0c86c2c9
...
@@ -261,10 +261,8 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
...
@@ -261,10 +261,8 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
const
char
*
psz_module
,
const
char
*
psz_module
,
const
char
*
psz_format
,
va_list
_args
)
const
char
*
psz_format
,
va_list
_args
)
{
{
size_t
i_header_size
;
/* Size of the additionnal header */
vlc_object_t
*
p_obj
;
vlc_object_t
*
p_obj
;
char
*
psz_str
=
NULL
;
/* formatted message string */
char
*
psz_str
=
NULL
;
/* formatted message string */
char
*
psz_header
=
NULL
;
va_list
args
;
va_list
args
;
assert
(
p_this
);
assert
(
p_this
);
...
@@ -366,14 +364,18 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
...
@@ -366,14 +364,18 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
}
}
uselocale
(
locale
);
uselocale
(
locale
);
msg_item_t
*
p_item
=
malloc
(
sizeof
(
*
p_item
));
/* Fill message information fields */
if
(
p_item
==
NULL
)
msg_item_t
msg
;
return
;
/* Uho! */
p_item
->
psz_module
=
p_item
->
psz_msg
=
p_item
->
psz_header
=
NULL
;
msg
.
i_type
=
i_type
;
msg
.
i_object_id
=
(
uintptr_t
)
p_this
;
msg
.
psz_object_type
=
p_this
->
psz_object_type
;
msg
.
psz_module
=
strdup
(
psz_module
);
msg
.
psz_msg
=
psz_str
;
char
*
psz_header
=
NULL
;
size_t
i_header_size
=
0
;
i_header_size
=
0
;
p_obj
=
p_this
;
p_obj
=
p_this
;
while
(
p_obj
!=
NULL
)
while
(
p_obj
!=
NULL
)
{
{
...
@@ -399,15 +401,9 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
...
@@ -399,15 +401,9 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
p_obj
=
p_obj
->
p_parent
;
p_obj
=
p_obj
->
p_parent
;
}
}
/* Fill message information fields */
msg
.
psz_header
=
psz_header
;
p_item
->
i_type
=
i_type
;
p_item
->
i_object_id
=
(
uintptr_t
)
p_this
;
p_item
->
psz_object_type
=
p_this
->
psz_object_type
;
p_item
->
psz_module
=
strdup
(
psz_module
);
p_item
->
psz_msg
=
psz_str
;
p_item
->
psz_header
=
psz_header
;
PrintMsg
(
p_this
,
p_item
);
PrintMsg
(
p_this
,
&
msg
);
vlc_rwlock_rdlock
(
&
bank
->
lock
);
vlc_rwlock_rdlock
(
&
bank
->
lock
);
for
(
int
i
=
0
;
i
<
bank
->
i_sub
;
i
++
)
for
(
int
i
=
0
;
i
<
bank
->
i_sub
;
i
++
)
...
@@ -416,17 +412,17 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
...
@@ -416,17 +412,17 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
libvlc_priv_t
*
priv
=
libvlc_priv
(
sub
->
instance
);
libvlc_priv_t
*
priv
=
libvlc_priv
(
sub
->
instance
);
msg_bank_t
*
bank
=
priv
->
msg_bank
;
msg_bank_t
*
bank
=
priv
->
msg_bank
;
void
*
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
void
*
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
p_item
->
psz_module
);
msg
.
psz_module
);
if
(
val
==
kObjectPrintingDisabled
)
continue
;
if
(
val
==
kObjectPrintingDisabled
)
continue
;
if
(
val
!=
kObjectPrintingEnabled
)
/*if not allowed */
if
(
val
!=
kObjectPrintingEnabled
)
/*if not allowed */
{
{
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
val
=
vlc_dictionary_value_for_key
(
&
bank
->
enabled_objects
,
p_item
->
psz_object_type
);
msg
.
psz_object_type
);
if
(
val
==
kObjectPrintingDisabled
)
continue
;
if
(
val
==
kObjectPrintingDisabled
)
continue
;
if
(
val
==
kObjectPrintingEnabled
);
/* Allowed */
if
(
val
==
kObjectPrintingEnabled
);
/* Allowed */
else
if
(
!
bank
->
all_objects_enabled
)
continue
;
else
if
(
!
bank
->
all_objects_enabled
)
continue
;
}
}
switch
(
p_item
->
i_type
)
switch
(
msg
.
i_type
)
{
{
case
VLC_MSG_INFO
:
case
VLC_MSG_INFO
:
case
VLC_MSG_ERR
:
case
VLC_MSG_ERR
:
...
@@ -440,10 +436,12 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
...
@@ -440,10 +436,12 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
break
;
break
;
}
}
sub
->
func
(
sub
->
opaque
,
p_item
,
0
);
sub
->
func
(
sub
->
opaque
,
&
msg
,
0
);
}
}
vlc_rwlock_unlock
(
&
bank
->
lock
);
vlc_rwlock_unlock
(
&
bank
->
lock
);
msg_Free
(
p_item
);
free
(
msg
.
psz_module
);
free
(
msg
.
psz_msg
);
free
(
msg
.
psz_header
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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