Changeset 8efc07b1b8b63e8ea49e8b60fcd53b1ee1fb0a3d
- Timestamp:
- 08/18/07 07:02:43
(1 year ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1187413363 +0000
- git-parent:
[d555c8a942eb34afd21dba4e443770aa8c29441d]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1187413363 +0000
- Message:
modules/services_discovery/sap.c: Use the new service discovery api.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5cfa9d1 |
r8efc07b |
|
| 220 | 220 | |
|---|
| 221 | 221 | int i_input_id; |
|---|
| 222 | | int i_item_id_cat; |
|---|
| 223 | | int i_item_id_one; |
|---|
| 224 | 222 | }; |
|---|
| 225 | 223 | |
|---|
| … | … | |
| 229 | 227 | int i_fd; |
|---|
| 230 | 228 | int *pi_fd; |
|---|
| 231 | | |
|---|
| 232 | | /* playlist node */ |
|---|
| 233 | | playlist_item_t *p_node_cat; |
|---|
| 234 | | playlist_item_t *p_node_one; |
|---|
| 235 | 229 | |
|---|
| 236 | 230 | /* Table of announces */ |
|---|
| … | … | |
| 310 | 304 | p_sys->b_timeshift = var_CreateGetInteger( p_sd, "sap-timeshift" ); |
|---|
| 311 | 305 | |
|---|
| 312 | | /* Create our playlist node */ |
|---|
| 313 | | pl_Yield( p_sd ); |
|---|
| 314 | | |
|---|
| 315 | | playlist_NodesPairCreate( pl_Get( p_sd ), _("SAP sessions"), |
|---|
| 316 | | &p_sys->p_node_cat, &p_sys->p_node_one, |
|---|
| 317 | | VLC_TRUE ); |
|---|
| 318 | | p_sys->p_node_cat->p_input->b_prefers_tree = VLC_TRUE; |
|---|
| | 306 | /* Set our name */ |
|---|
| | 307 | services_discovery_SetLocalizedName( p_sd, _("SAP sessions") ); |
|---|
| | 308 | |
|---|
| 319 | 309 | p_sys->i_announces = 0; |
|---|
| 320 | 310 | p_sys->pp_announces = NULL; |
|---|
| … | … | |
| 439 | 429 | FREENULL( p_sys->pp_announces ); |
|---|
| 440 | 430 | |
|---|
| 441 | | playlist_NodeDelete( pl_Get(p_sd), p_sys->p_node_cat, VLC_TRUE, |
|---|
| 442 | | VLC_TRUE ); |
|---|
| 443 | | playlist_NodeDelete( pl_Get(p_sd), p_sys->p_node_one, VLC_TRUE, |
|---|
| 444 | | VLC_TRUE ); |
|---|
| 445 | 431 | pl_Release( p_sd ); |
|---|
| 446 | 432 | free( p_sys ); |
|---|
| … | … | |
| 781 | 767 | { |
|---|
| 782 | 768 | input_item_t *p_input; |
|---|
| 783 | | playlist_item_t *p_item, *p_child; |
|---|
| 784 | 769 | const char *psz_value; |
|---|
| 785 | 770 | sap_announce_t *p_sap = (sap_announce_t *)malloc( |
|---|
| … | … | |
| 828 | 813 | psz_value = GetAttribute( p_sap->p_sdp->pp_attributes, p_sap->p_sdp->i_attributes, "x-plgroup" ); |
|---|
| 829 | 814 | |
|---|
| 830 | | if( psz_value != NULL ) |
|---|
| 831 | | { |
|---|
| 832 | | p_child = playlist_ChildSearchName( p_sys->p_node_cat, psz_value ); |
|---|
| 833 | | |
|---|
| 834 | | if( p_child == NULL ) |
|---|
| 835 | | { |
|---|
| 836 | | p_child = playlist_NodeCreate( pl_Get( p_sd ), psz_value, |
|---|
| 837 | | p_sys->p_node_cat, 0 ); |
|---|
| 838 | | p_child->i_flags &= ~PLAYLIST_SKIP_FLAG; |
|---|
| 839 | | } |
|---|
| 840 | | } |
|---|
| 841 | | else |
|---|
| 842 | | { |
|---|
| 843 | | p_child = p_sys->p_node_cat; |
|---|
| 844 | | } |
|---|
| 845 | | |
|---|
| 846 | | p_item = playlist_NodeAddInput( pl_Get( p_sd ), p_input, p_child, |
|---|
| 847 | | PLAYLIST_APPEND, PLAYLIST_END, VLC_FALSE ); |
|---|
| 848 | | p_item->i_flags &= ~PLAYLIST_SKIP_FLAG; |
|---|
| 849 | | p_item->i_flags &= ~PLAYLIST_SAVE_FLAG; |
|---|
| 850 | | p_sap->i_item_id_cat = p_item->i_id; |
|---|
| 851 | | |
|---|
| 852 | | p_item = playlist_NodeAddInput( pl_Get( p_sd ), p_input, |
|---|
| 853 | | p_sys->p_node_one, PLAYLIST_APPEND, PLAYLIST_END, |
|---|
| 854 | | VLC_FALSE ); |
|---|
| 855 | | p_item->i_flags &= ~PLAYLIST_SKIP_FLAG; |
|---|
| 856 | | p_item->i_flags &= ~PLAYLIST_SAVE_FLAG; |
|---|
| 857 | | p_sap->i_item_id_one = p_item->i_id; |
|---|
| | 815 | services_discovery_AddItem( p_sd, p_input, psz_value /* category name */ ); |
|---|
| 858 | 816 | |
|---|
| 859 | 817 | TAB_APPEND( p_sys->i_announces, p_sys->pp_announces, p_sap ); |
|---|