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
595e377e
Commit
595e377e
authored
Jan 31, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC log: remove exceptions
parent
47f6cc9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
37 deletions
+35
-37
include/vlc/libvlc.h
include/vlc/libvlc.h
+6
-10
src/control/log.c
src/control/log.c
+29
-27
No files found.
include/vlc/libvlc.h
View file @
595e377e
...
...
@@ -339,10 +339,9 @@ VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, uns
* Open a VLC message log instance.
*
* \param p_instance libvlc instance
* \param p_e an initialized exception pointer
* \return log message instance
* \return log message instance or NULL on error
*/
VLC_PUBLIC_API
libvlc_log_t
*
libvlc_log_open
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
libvlc_log_t
*
libvlc_log_open
(
libvlc_instance_t
*
);
/**
* Close a VLC message log instance.
...
...
@@ -373,10 +372,9 @@ VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *p_log );
* Allocate and returns a new iterator to messages in log.
*
* \param p_log libvlc log instance
* \param p_e an initialized exception pointer
* \return log iterator object
* \return log iterator object or NULL on error
*/
VLC_PUBLIC_API
libvlc_log_iterator_t
*
libvlc_log_get_iterator
(
const
libvlc_log_t
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
libvlc_log_iterator_t
*
libvlc_log_get_iterator
(
const
libvlc_log_t
*
);
/**
* Release a previoulsy allocated iterator.
...
...
@@ -400,12 +398,10 @@ VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_
*
* \param p_iter libvlc log iterator or NULL
* \param p_buffer log buffer
* \param p_e an initialized exception pointer
* \return log message object
* \return log message object or NULL if none left
*/
VLC_PUBLIC_API
libvlc_log_message_t
*
libvlc_log_iterator_next
(
libvlc_log_iterator_t
*
p_iter
,
libvlc_log_message_t
*
p_buffer
,
libvlc_exception_t
*
p_e
);
libvlc_log_message_t
*
p_buffer
);
/** @} */
...
...
src/control/log.c
View file @
595e377e
...
...
@@ -89,12 +89,14 @@ void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level )
p_instance
->
verbosity
=
level
;
}
libvlc_log_t
*
libvlc_log_open
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_e
)
libvlc_log_t
*
libvlc_log_open
(
libvlc_instance_t
*
p_instance
)
{
struct
libvlc_log_t
*
p_log
=
(
struct
libvlc_log_t
*
)
malloc
(
sizeof
(
struct
libvlc_log_t
));
if
(
!
p_log
)
RAISENULL
(
"Out of memory"
);
struct
libvlc_log_t
*
p_log
=
malloc
(
sizeof
(
*
p_log
));
if
(
unlikely
(
p_log
==
NULL
))
{
libvlc_printerr
(
"Not enough memory"
);
return
NULL
;
}
p_log
->
p_instance
=
p_instance
;
vlc_spin_init
(
&
p_log
->
data
.
lock
);
...
...
@@ -105,7 +107,8 @@ libvlc_log_t *libvlc_log_open( libvlc_instance_t *p_instance, libvlc_exception_t
if
(
!
p_log
->
p_messages
)
{
free
(
p_log
);
RAISENULL
(
"Out of memory"
);
libvlc_printerr
(
"Not enough memory"
);
return
NULL
;
}
libvlc_retain
(
p_instance
);
...
...
@@ -156,27 +159,27 @@ void libvlc_log_clear( libvlc_log_t *p_log )
msg_Release
(
tab
[
i
]);
}
libvlc_log_iterator_t
*
libvlc_log_get_iterator
(
const
libvlc_log_t
*
p_log
,
libvlc_exception_t
*
p_e
)
libvlc_log_iterator_t
*
libvlc_log_get_iterator
(
const
libvlc_log_t
*
p_log
)
{
if
(
p_log
)
if
(
p_log
==
NULL
)
return
NULL
;
struct
libvlc_log_iterator_t
*
p_iter
=
malloc
(
sizeof
(
*
p_iter
));
if
(
unlikely
(
p_iter
==
NULL
))
{
struct
libvlc_log_iterator_t
*
p_iter
=
(
struct
libvlc_log_iterator_t
*
)
malloc
(
sizeof
(
struct
libvlc_log_iterator_t
));
libvlc_printerr
(
"Not enough memory"
);
return
NULL
;
}
/* FIXME: break constant pointer constraints */
msg_cb_data_t
*
data
=
&
((
libvlc_log_t
*
)
p_log
)
->
data
;
if
(
!
p_iter
)
RAISENULL
(
"Out of memory"
);
vlc_spin_lock
(
&
data
->
lock
);
p_iter
->
p_data
=
data
;
p_iter
->
i_pos
=
0
;
p_iter
->
i_end
=
data
->
count
;
vlc_spin_unlock
(
&
data
->
lock
);
return
p_iter
;
}
RAISENULL
(
"Invalid log object!"
);
}
void
libvlc_log_iterator_free
(
libvlc_log_iterator_t
*
p_iter
)
...
...
@@ -192,14 +195,13 @@ int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter )
}
libvlc_log_message_t
*
libvlc_log_iterator_next
(
libvlc_log_iterator_t
*
p_iter
,
libvlc_log_message_t
*
buffer
,
libvlc_exception_t
*
p_e
)
libvlc_log_message_t
*
buffer
)
{
unsigned
i_pos
;
if
(
!
p_iter
)
return
NULL
;
assert
(
buffer
);
assert
(
buffer
!=
NULL
);
i_pos
=
p_iter
->
i_pos
;
if
(
i_pos
!=
p_iter
->
i_end
)
...
...
@@ -217,5 +219,5 @@ libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
return
buffer
;
}
RAISENULL
(
"No more messages"
)
;
return
NULL
;
}
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