[vlc-devel] commit: Input and playlist: use custom object ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Mar 29 15:15:41 CET 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sat Mar 29 15:54:14 2008 +0200| [28257ce4bce64b205c41a0024a0e90a9baea01f9]
Input and playlist: use custom object
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28257ce4bce64b205c41a0024a0e90a9baea01f9
---
src/input/input.c | 11 +++++++----
src/misc/objects.c | 9 ---------
src/playlist/engine.c | 4 +++-
3 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/input/input.c b/src/input/input.c
index dbe4a66..3fdae93 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -43,7 +43,6 @@
#include <vlc_playlist.h>
#include <vlc_interface.h>
#include <vlc_url.h>
-#include <vlc_demux.h>
#include <vlc_charset.h>
#ifdef HAVE_SYS_STAT_H
@@ -113,7 +112,8 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* * Get only:
* - length
* - bookmarks
- * - seekable (if you can seek, it doesn't say if 'bar display' has be shown or not, for that check position != 0.0)
+ * - seekable (if you can seek, it doesn't say if 'bar display' has be shown
+ * or not, for that check position != 0.0)
* - can-pause
* * For intf callback upon changes
* - intf-change
@@ -122,14 +122,17 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* TODO complete this list (?)
*****************************************************************************/
static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
- const char *psz_header, vlc_bool_t b_quick, sout_instance_t *p_sout )
+ const char *psz_header, vlc_bool_t b_quick,
+ sout_instance_t *p_sout )
{
+ static const char input_name[] = "input";
input_thread_t *p_input = NULL; /* thread descriptor */
vlc_value_t val;
int i;
/* Allocate descriptor */
- p_input = vlc_object_create( p_parent, VLC_OBJECT_INPUT );
+ p_input = vlc_custom_create( p_parent, sizeof( *p_input ),
+ VLC_OBJECT_INPUT, input_name );
if( p_input == NULL )
{
msg_Err( p_parent, "out of memory" );
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 211a2ca..011b12f 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -48,7 +48,6 @@
#include <vlc_sout.h>
#include "stream_output/stream_output.h"
-#include "vlc_playlist.h"
#include "vlc_interface.h"
#include "vlc_codec.h"
#include "vlc_filter.h"
@@ -256,14 +255,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
i_size = sizeof(intf_thread_t);
psz_type = "dialogs";
break;
- case VLC_OBJECT_PLAYLIST:
- i_size = sizeof(playlist_t);
- psz_type = "playlist";
- break;
- case VLC_OBJECT_INPUT:
- i_size = sizeof(input_thread_t);
- psz_type = "input";
- break;
case VLC_OBJECT_DEMUX:
i_size = sizeof(demux_t);
psz_type = "demux";
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index bf0201d..55c084b 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -59,12 +59,14 @@ static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd,
*/
playlist_t * playlist_Create( vlc_object_t *p_parent )
{
+ static const char playlist_name[] = "playlist";
playlist_t *p_playlist;
vlc_bool_t b_save;
int i_tree;
/* Allocate structure */
- p_playlist = vlc_object_create( p_parent, VLC_OBJECT_PLAYLIST );
+ p_playlist = vlc_custom_create( p_parent, sizeof( *p_playlist ),
+ VLC_OBJECT_PLAYLIST, playlist_name );
if( !p_playlist )
{
msg_Err( p_parent, "out of memory" );
More information about the vlc-devel
mailing list