Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (17)
Showing
with 189 additions and 19 deletions
......@@ -211,6 +211,12 @@ typedef struct libvlc_media_slave_t
unsigned int i_priority;
} libvlc_media_slave_t;
/**
* Type of stat that can be requested from libvlc_media_get_stat()
*/
#define libvlc_media_stat_mtime 0
#define libvlc_media_stat_size 1
/**
* Callback prototype to open a custom bitstream input media.
*
......@@ -560,6 +566,22 @@ LIBVLC_API libvlc_event_manager_t *
LIBVLC_API libvlc_time_t
libvlc_media_get_duration( libvlc_media_t *p_md );
/**
* Get a 'stat' value of media descriptor object item.
*
* \note 'stat' values are currently only parsed by directory accesses. This
* mean that only sub medias of a directory media, parsed with
* libvlc_media_parse_with_options() can have valid 'stat' properties.
* \version LibVLC 4.0.0 and later.
*
* \param p_md media descriptor object
* \param type a valid libvlc_media_stat_ define
* \param out field in which the value will be stored
* \return 1 on success, 0 if not found, -1 on error.
*/
LIBVLC_API int
libvlc_media_get_stat( libvlc_media_t *p_md, unsigned type, uint64_t *out );
/**
* Parse the media asynchronously with options.
*
......
......@@ -55,6 +55,16 @@ struct info_category_t
struct vlc_list infos; /**< Infos in the category */
};
/**
* Returns true if the category is hidden
*
* Infos from hidden categories should not be displayed directly by UI modules.
*/
static inline bool info_category_IsHidden(info_category_t *cat)
{
return cat->psz_name[0] == '.';
}
enum input_item_type_e
{
ITEM_TYPE_UNKNOWN,
......@@ -335,6 +345,9 @@ VLC_API int input_item_DelInfo( input_item_t *p_i, const char *psz_cat, const ch
VLC_API void input_item_ReplaceInfos( input_item_t *, info_category_t * );
VLC_API void input_item_MergeInfos( input_item_t *, info_category_t * );
#define input_item_AddStat(item, type, value) \
input_item_AddInfo(item, ".stat", type, "%" PRIu64, (uint64_t) value)
/**
* This function creates a new input_item_t with the provided information.
*
......@@ -582,10 +595,14 @@ VLC_API void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_
* be valid.
* \param i_type see \ref input_item_type_e
* \param i_net see \ref input_item_net_type
* \param[out] created_item if an input item is created. The item should not be
* released and is valid until vlc_readdir_helper_finish() is called.
* \param status VLC_SUCCESS in case of success, an error otherwise. Parsing
* should be aborted in case of error.
*/
VLC_API int vlc_readdir_helper_additem(struct vlc_readdir_helper *p_rdh,
const char *psz_uri, const char *psz_flatpath,
const char *psz_filename,
int i_type, int i_net);
int i_type, int i_net, input_item_t **created_item);
#endif
......@@ -73,6 +73,7 @@ libvlc_media_duplicate
libvlc_media_event_manager
libvlc_media_get_codec_description
libvlc_media_get_duration
libvlc_media_get_stat
libvlc_media_get_meta
libvlc_media_get_mrl
libvlc_media_get_state
......
......@@ -838,6 +838,43 @@ libvlc_media_get_duration( libvlc_media_t * p_md )
return from_mtime(input_item_GetDuration( p_md->p_input_item ));
}
int
libvlc_media_get_stat( libvlc_media_t *p_md, unsigned type, uint64_t *out )
{
assert( p_md );
assert( out );
if( !p_md->p_input_item )
{
libvlc_printerr( "No input item" );
return -1;
}
const char *name;
switch (type)
{
case libvlc_media_stat_mtime: name = "mtime"; break;
case libvlc_media_stat_size: name = "size"; break;
default:
libvlc_printerr( "unknown libvlc_media_stat" );
return -1;
};
char *str = input_item_GetInfo( p_md->p_input_item, ".stat", name );
if( str == NULL )
return 0;
char *end;
unsigned long long val = strtoull( str, &end, 10 );
free( str );
if( *end != '\0' )
return -1;
*out = val;
return 1;
}
static const input_preparser_callbacks_t input_preparser_callbacks = {
.on_preparse_ended = input_item_preparse_ended,
.on_subtree_added = input_item_subtree_added,
......
......@@ -207,8 +207,15 @@ static int DirRead (stream_t *access, input_item_node_t *node)
ret = VLC_ENOMEM;
break;
}
input_item_t *p_item;
ret = vlc_readdir_helper_additem(&rdh, uri, NULL, entry, type,
ITEM_NET_UNKNOWN);
ITEM_NET_UNKNOWN, &p_item);
if (ret == VLC_SUCCESS && p_item && st.st_mtime >= 0 && st.st_size >= 0)
{
input_item_AddStat( p_item, "mtime", st.st_mtime );
input_item_AddStat( p_item, "size", st.st_size );
}
free(uri);
}
......
......@@ -118,7 +118,7 @@ static int get_address( stream_t *p_access );
static int login( stream_t *p_access );
static bool get_path( stream_t *p_access );
static int add_item( stream_t *p_access, struct vlc_readdir_helper *p_rdh,
const char *psz_name, int i_type );
const char *psz_name, int i_type, smb_stat *p_st );
typedef struct
{
......@@ -576,7 +576,7 @@ static int Control( stream_t *p_access, int i_query, va_list args )
}
static int add_item( stream_t *p_access, struct vlc_readdir_helper *p_rdh,
const char *psz_name, int i_type )
const char *psz_name, int i_type, smb_stat *p_st )
{
char *psz_uri;
int i_ret;
......@@ -593,8 +593,14 @@ static int add_item( stream_t *p_access, struct vlc_readdir_helper *p_rdh,
if( i_ret == -1 )
return VLC_ENOMEM;
input_item_t *p_item;
i_ret = vlc_readdir_helper_additem( p_rdh, psz_uri, NULL, psz_name, i_type,
ITEM_NET );
ITEM_NET, &p_item );
if ( i_ret == VLC_SUCCESS && p_item && p_st )
{
input_item_AddStat( p_item, "mtime", smb_stat_get( *p_st, SMB_STAT_MTIME ));
input_item_AddStat( p_item, "size", smb_stat_get( *p_st, SMB_STAT_SIZE ));
}
free( psz_uri );
return i_ret;
}
......@@ -621,7 +627,7 @@ static int BrowseShare( stream_t *p_access, input_item_node_t *p_node )
if( psz_name[strlen( psz_name ) - 1] == '$')
continue;
i_ret = add_item( p_access, &rdh, psz_name, ITEM_TYPE_DIRECTORY );
i_ret = add_item( p_access, &rdh, psz_name, ITEM_TYPE_DIRECTORY, NULL );
}
vlc_readdir_helper_finish( &rdh, i_ret == VLC_SUCCESS );
......@@ -672,7 +678,7 @@ static int BrowseDirectory( stream_t *p_access, input_item_node_t *p_node )
i_type = smb_stat_get( st, SMB_STAT_ISDIR ) ?
ITEM_TYPE_DIRECTORY : ITEM_TYPE_FILE;
i_ret = add_item( p_access, &rdh, psz_name, i_type );
i_ret = add_item( p_access, &rdh, psz_name, i_type, &st );
}
vlc_readdir_helper_finish( &rdh, i_ret == VLC_SUCCESS );
......
......@@ -999,7 +999,7 @@ static int DirRead (stream_t *p_access, input_item_node_t *p_current_node)
msg_Err(p_access, "%s -> %s", p_sys->url.psz_path, ms.ptr);
i_ret = vlc_readdir_helper_additem( &rdh, ms.ptr, NULL, psz_file,
type, ITEM_NET );
type, ITEM_NET, NULL );
free(ms.ptr);
}
free( psz_line );
......
......@@ -363,8 +363,16 @@ DirRead(stream_t *p_access, input_item_node_t *p_node)
default:
i_type = ITEM_TYPE_UNKNOWN;
}
input_item_t *p_item;
i_ret = vlc_readdir_helper_additem(&rdh, psz_url, NULL, p_nfsdirent->name,
i_type, ITEM_NET);
i_type, ITEM_NET, &p_item);
if (i_ret == VLC_SUCCESS && p_item && p_nfsdirent->mtime.tv_sec >= 0)
{
input_item_AddStat(p_item, "mtime", p_nfsdirent->mtime.tv_sec);
input_item_AddStat(p_item, "size", p_nfsdirent->size);
}
free(psz_url);
}
......@@ -394,7 +402,7 @@ MountRead(stream_t *p_access, input_item_node_t *p_node)
break;
}
i_ret = vlc_readdir_helper_additem(&rdh, psz_url, NULL, psz_name,
ITEM_TYPE_DIRECTORY, ITEM_NET);
ITEM_TYPE_DIRECTORY, ITEM_NET, NULL);
free(psz_url);
}
......
......@@ -169,9 +169,18 @@ static int DirRead (stream_t *p_access, input_item_node_t *p_node )
i_ret = VLC_ENOMEM;
break;
}
struct stat st;
smbc_stat(uri, &st);
input_item_t *p_item;
free(psz_encoded_name);
i_ret = vlc_readdir_helper_additem(&rdh, uri, NULL, p_entry->name,
i_type, ITEM_NET);
i_type, ITEM_NET, &p_item);
if (i_ret == VLC_SUCCESS && p_item)
{
input_item_AddStat( p_item, "mtime", st.st_mtime );
input_item_AddStat( p_item, "size", st.st_size );
}
free(uri);
}
......
......@@ -670,8 +670,15 @@ static int DirRead (stream_t *p_access, input_item_node_t *p_current_node)
free( psz_uri );
int i_type = LIBSSH2_SFTP_S_ISDIR( attrs.permissions ) ? ITEM_TYPE_DIRECTORY : ITEM_TYPE_FILE;
input_item_t *p_item;
i_ret = vlc_readdir_helper_additem( &rdh, psz_full_uri, NULL, psz_file,
i_type, ITEM_NET );
i_type, ITEM_NET, &p_item );
if (i_ret == VLC_SUCCESS && p_item)
{
input_item_AddStat(p_item, "mtime", attrs.mtime);
input_item_AddStat(p_item, "size", attrs.filesize);
}
free( psz_full_uri );
}
......
......@@ -374,7 +374,7 @@ vlc_smb2_get_url(vlc_url_t *url, const char *file)
}
static int AddItem(stream_t *access, struct vlc_readdir_helper *rdh,
const char *name, int i_type)
const char* name, int i_type, struct smb2_stat_64 *stats)
{
struct access_sys *sys = access->p_sys;
char *name_encoded = vlc_uri_encode(name);
......@@ -386,8 +386,15 @@ static int AddItem(stream_t *access, struct vlc_readdir_helper *rdh,
if (url == NULL)
return VLC_ENOMEM;
input_item_t *p_item;
int ret = vlc_readdir_helper_additem(rdh, url, NULL, name, i_type,
ITEM_NET);
ITEM_NET, &p_item);
if (ret == VLC_SUCCESS && p_item && stats)
{
input_item_AddStat( p_item, "mtime", stats->smb2_mtime);
input_item_AddStat( p_item, "size", stats->smb2_size);
}
free(url);
return ret;
}
......@@ -419,7 +426,7 @@ DirRead(stream_t *access, input_item_node_t *p_node)
i_type = ITEM_TYPE_UNKNOWN;
break;
}
ret = AddItem(access, &rdh, smb2dirent->name, i_type);
ret = AddItem(access, &rdh, smb2dirent->name, i_type, &smb2dirent->st);
}
vlc_readdir_helper_finish(&rdh, ret == VLC_SUCCESS);
......@@ -447,7 +454,7 @@ ShareEnum(stream_t *access, input_item_node_t *p_node)
switch (info->type & 0x3)
{
case SHARE_TYPE_DISKTREE:
ret = AddItem(access, &rdh, info->name, ITEM_TYPE_DIRECTORY);
ret = AddItem(access, &rdh, info->name, ITEM_TYPE_DIRECTORY, NULL);
break;
}
}
......
......@@ -212,7 +212,7 @@ static int DirRead(stream_t *p_access, input_item_node_t *p_node)
free( psz_path );
i_ret = vlc_readdir_helper_additem( &rdh, psz_uri, NULL,
psz_name, ITEM_TYPE_DIRECTORY, ITEM_NET );
psz_name, ITEM_TYPE_DIRECTORY, ITEM_NET, NULL );
free( psz_name );
free( psz_uri );
}
......
......@@ -513,6 +513,9 @@ static int PlayerItemInfo(struct cli_client *cl, const char *const *args,
info_category_t *category = item->pp_categories[i];
info_t *info;
if (info_category_IsHidden(category))
continue;
cli_printf(cl, "+----[ %s ]", category->psz_name);
cli_printf(cl, "| ");
info_foreach(info, &category->infos)
......
......@@ -356,6 +356,9 @@
info_category_t *cat = p_input->pp_categories[i];
info_t *info;
if (info_category_IsHidden(cat))
continue;
VLCCodecInformationTreeItem *subItem = [[VLCCodecInformationTreeItem alloc] init];
subItem.propertyName = toNSStr(cat->psz_name);
......
......@@ -654,6 +654,9 @@ static int DrawInfo(intf_thread_t *intf)
info_category_t *p_category = item->pp_categories[i];
info_t *p_info;
if (info_category_IsHidden(p_category))
continue;
if (sys->color) color_set(C_CATEGORY, NULL);
MainBoxWrite(sys, l++, _(" [%s]"), p_category->psz_name);
if (sys->color) color_set(C_DEFAULT, NULL);
......
......@@ -502,6 +502,9 @@ void InfoPanel::update( input_item_t *p_item)
for( int i = 0; i< p_item->i_categories ; i++)
{
if (info_category_IsHidden(p_item->pp_categories[i]))
continue;
struct vlc_list *const head = &p_item->pp_categories[i]->infos;
current_item = new QTreeWidgetItem();
......
......@@ -71,6 +71,9 @@ static int vlclua_input_item_info( lua_State *L )
info_category_t *p_category = p_item->pp_categories[i];
info_t *p_info;
if (info_category_IsHidden(p_category))
continue;
lua_pushstring( L, p_category->psz_name );
lua_newtable( L );
info_foreach(p_info, &p_category->infos)
......
......@@ -547,12 +547,23 @@ static int ReadDir( stream_directory_t* p_directory, input_item_node_t* p_node )
if( unlikely( !mrl ) )
break;
input_item_t *p_item;
if( vlc_readdir_helper_additem( &rdh, mrl, path, NULL, ITEM_TYPE_FILE,
ITEM_LOCAL ) )
ITEM_LOCAL, &p_item ) )
{
free( mrl );
break;
}
if ( p_item )
{
time_t mtime = archive_entry_mtime( entry );
if( mtime >= 0 )
input_item_AddStat( p_item, "mtime", mtime );
int64_t size = archive_entry_size( entry );
if( size >= 0 )
input_item_AddStat( p_item, "size", size );
}
free( mrl );
if( archive_read_data_skip( p_arc ) )
......
......@@ -1823,7 +1823,8 @@ void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success)
int vlc_readdir_helper_additem(struct vlc_readdir_helper *p_rdh,
const char *psz_uri, const char *psz_flatpath,
const char *psz_filename, int i_type, int i_net)
const char *psz_filename, int i_type, int i_net,
input_item_t **restrict created_item)
{
enum slave_type i_slave_type;
struct rdh_slave *p_rdh_slave = NULL;
......@@ -1869,7 +1870,11 @@ int vlc_readdir_helper_additem(struct vlc_readdir_helper *p_rdh,
}
if (rdh_file_is_ignored(p_rdh, psz_filename))
{
if (created_item != NULL)
*created_item = NULL;
return VLC_SUCCESS;
}
input_item_node_t *p_node = p_rdh->p_node;
......@@ -1896,5 +1901,8 @@ int vlc_readdir_helper_additem(struct vlc_readdir_helper *p_rdh,
* slaves will be ignored by rdh_file_is_ignored() */
if (p_rdh_slave != NULL)
p_rdh_slave->p_node = p_node;
if (created_item != NULL)
*created_item = p_item;
return VLC_SUCCESS;
}
......@@ -238,6 +238,21 @@ static void subitem_added(const libvlc_event_t *event, void *user_data)
assert (!subitems_found[i]);
assert (libvlc_media_get_type(m) == test_media_subitems_list[i].type);
subitems_found[i] = true;
uint64_t value;
int ret;
ret = libvlc_media_get_stat(m, libvlc_media_stat_size, &value);
assert(ret == 1);
/* All files size are 0, directory size is either 4096 or 0 */
if (libvlc_media_get_type(m) == libvlc_media_type_directory)
assert(value == 4096 || value == 0);
else
assert(value == 0);
ret = libvlc_media_get_stat(m, libvlc_media_stat_mtime, &value);
/* Epoch timestamp of the commit that added test/samples/subitems */
assert(ret == 1 && value >= 1446796477);
}
}
free (mrl);
......