Commit 28257ce4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Input and playlist: use custom object

parent 250dcb47
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include <vlc_interface.h> #include <vlc_interface.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_demux.h>
#include <vlc_charset.h> #include <vlc_charset.h>
#ifdef HAVE_SYS_STAT_H #ifdef HAVE_SYS_STAT_H
...@@ -113,7 +112,8 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta ...@@ -113,7 +112,8 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* * Get only: * * Get only:
* - length * - length
* - bookmarks * - 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 * - can-pause
* * For intf callback upon changes * * For intf callback upon changes
* - intf-change * - intf-change
...@@ -122,14 +122,17 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta ...@@ -122,14 +122,17 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
* TODO complete this list (?) * TODO complete this list (?)
*****************************************************************************/ *****************************************************************************/
static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, 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 */ input_thread_t *p_input = NULL; /* thread descriptor */
vlc_value_t val; vlc_value_t val;
int i; int i;
/* Allocate descriptor */ /* 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 ) if( p_input == NULL )
{ {
msg_Err( p_parent, "out of memory" ); msg_Err( p_parent, "out of memory" );
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include <vlc_sout.h> #include <vlc_sout.h>
#include "stream_output/stream_output.h" #include "stream_output/stream_output.h"
#include "vlc_playlist.h"
#include "vlc_interface.h" #include "vlc_interface.h"
#include "vlc_codec.h" #include "vlc_codec.h"
#include "vlc_filter.h" #include "vlc_filter.h"
...@@ -256,14 +255,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type ) ...@@ -256,14 +255,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
i_size = sizeof(intf_thread_t); i_size = sizeof(intf_thread_t);
psz_type = "dialogs"; psz_type = "dialogs";
break; 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: case VLC_OBJECT_DEMUX:
i_size = sizeof(demux_t); i_size = sizeof(demux_t);
psz_type = "demux"; psz_type = "demux";
......
...@@ -59,12 +59,14 @@ static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -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 ) playlist_t * playlist_Create( vlc_object_t *p_parent )
{ {
static const char playlist_name[] = "playlist";
playlist_t *p_playlist; playlist_t *p_playlist;
vlc_bool_t b_save; vlc_bool_t b_save;
int i_tree; int i_tree;
/* Allocate structure */ /* 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 ) if( !p_playlist )
{ {
msg_Err( p_parent, "out of memory" ); msg_Err( p_parent, "out of memory" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment