Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a5b37333
Commit
a5b37333
authored
Jan 28, 2016
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upnp: getNextItem: Cosmetics
parent
a1efb1a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
24 deletions
+14
-24
modules/services_discovery/upnp.cpp
modules/services_discovery/upnp.cpp
+13
-23
modules/services_discovery/upnp.hpp
modules/services_discovery/upnp.hpp
+1
-1
No files found.
modules/services_discovery/upnp.cpp
View file @
a5b37333
...
@@ -718,7 +718,7 @@ input_item_t* MediaServer::newItem( const char *objectID, const char *title )
...
@@ -718,7 +718,7 @@ input_item_t* MediaServer::newItem( const char *objectID, const char *title )
return
p_item
;
return
p_item
;
}
}
input_item_t
*
MediaServer
::
newItem
(
const
char
*
title
,
const
char
*
,
const
char
*
,
input_item_t
*
MediaServer
::
newItem
(
const
char
*
title
,
const
char
*
,
mtime_t
duration
,
const
char
*
psz_url
)
mtime_t
duration
,
const
char
*
psz_url
)
{
{
return
input_item_NewWithTypeExt
(
psz_url
,
title
,
0
,
NULL
,
0
,
return
input_item_NewWithTypeExt
(
psz_url
,
title
,
0
,
NULL
,
0
,
...
@@ -910,35 +910,26 @@ input_item_t* MediaServer::getNextItem()
...
@@ -910,35 +910,26 @@ input_item_t* MediaServer::getNextItem()
if
(
itemNodeList_
)
if
(
itemNodeList_
)
{
{
for
(
;
!
p_item
&&
itemNodeIndex_
<
ixmlNodeList_length
(
itemNodeList_
)
for
(
;
!
p_item
&&
itemNodeIndex_
<
ixmlNodeList_length
(
itemNodeList_
)
;
itemNodeIndex_
++
)
;
itemNodeIndex_
++
)
{
{
IXML_Element
*
itemElement
=
IXML_Element
*
itemElement
=
(
IXML_Element
*
)
ixmlNodeList_item
(
itemNodeList_
,
(
IXML_Element
*
)
ixmlNodeList_item
(
itemNodeList_
,
itemNodeIndex_
);
itemNodeIndex_
);
const
char
*
objectID
=
const
char
*
objectID
=
ixmlElement_getAttribute
(
itemElement
,
"id"
);
ixmlElement_getAttribute
(
itemElement
,
"id"
);
if
(
!
objectID
)
if
(
!
objectID
)
continue
;
continue
;
const
char
*
title
=
const
char
*
title
=
xml_getChildElementValue
(
itemElement
,
"dc:title"
);
xml_getChildElementValue
(
itemElement
,
"dc:title"
);
if
(
!
title
)
if
(
!
title
)
continue
;
continue
;
const
char
*
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
const
char
*
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
"sec:CaptionInfo"
);
"sec:CaptionInfo"
);
if
(
!
psz_subtitles
)
if
(
!
psz_subtitles
)
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
"sec:CaptionInfoEx"
);
"sec:CaptionInfoEx"
);
if
(
!
psz_subtitles
)
if
(
!
psz_subtitles
)
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
psz_subtitles
=
xml_getChildElementValue
(
itemElement
,
"pv:subtitlefile"
);
"pv:subtitlefile"
);
/* Try to extract all resources in DIDL */
/* Try to extract all resources in DIDL */
IXML_NodeList
*
p_resource_list
=
ixmlDocument_getElementsByTagName
(
(
IXML_Document
*
)
itemElement
,
"res"
);
IXML_NodeList
*
p_resource_list
=
ixmlDocument_getElementsByTagName
(
(
IXML_Document
*
)
itemElement
,
"res"
);
...
@@ -954,14 +945,13 @@ input_item_t* MediaServer::getNextItem()
...
@@ -954,14 +945,13 @@ input_item_t* MediaServer::getNextItem()
if
(
psz_duration
)
if
(
psz_duration
)
{
{
int
i_hours
,
i_minutes
,
i_seconds
;
int
i_hours
,
i_minutes
,
i_seconds
;
if
(
sscanf
(
psz_duration
,
"%d:%02d:%02d"
,
if
(
sscanf
(
psz_duration
,
"%d:%02d:%02d"
,
&
i_hours
,
&
i_minutes
,
&
i_seconds
)
)
&
i_hours
,
&
i_minutes
,
&
i_seconds
)
)
i_duration
=
INT64_C
(
1000000
)
*
(
i_hours
*
3600
+
i_duration
=
INT64_C
(
1000000
)
*
(
i_hours
*
3600
+
i_minutes
*
60
+
i_minutes
*
60
+
i_seconds
);
i_seconds
);
}
}
p_item
=
newItem
(
title
,
objectID
,
psz_subtitles
,
i_duration
,
p_item
=
newItem
(
title
,
objectID
,
i_duration
,
psz_resource_url
);
psz_resource_url
);
}
}
ixmlNodeList_free
(
p_resource_list
);
ixmlNodeList_free
(
p_resource_list
);
...
...
modules/services_discovery/upnp.hpp
View file @
a5b37333
...
@@ -147,7 +147,7 @@ private:
...
@@ -147,7 +147,7 @@ private:
void
fetchContents
();
void
fetchContents
();
input_item_t
*
newItem
(
const
char
*
objectID
,
const
char
*
title
);
input_item_t
*
newItem
(
const
char
*
objectID
,
const
char
*
title
);
input_item_t
*
newItem
(
const
char
*
title
,
const
char
*
psz_objectID
,
const
char
*
psz_subtitles
,
mtime_t
duration
,
const
char
*
psz_url
);
input_item_t
*
newItem
(
const
char
*
title
,
const
char
*
psz_objectID
,
mtime_t
duration
,
const
char
*
psz_url
);
IXML_Document
*
_browseAction
(
const
char
*
,
const
char
*
,
IXML_Document
*
_browseAction
(
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
);
const
char
*
,
const
char
*
,
const
char
*
);
...
...
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