Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c0b26a3e
Commit
c0b26a3e
authored
Jul 30, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
podcast: set the duration of an input item when available.
parent
2416db15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
modules/demux/playlist/podcast.c
modules/demux/playlist/podcast.c
+21
-0
No files found.
modules/demux/playlist/podcast.c
View file @
c0b26a3e
...
...
@@ -46,6 +46,7 @@ struct demux_sys_t
*****************************************************************************/
static
int
Demux
(
demux_t
*
p_demux
);
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
);
static
mtime_t
strTimeToMTime
(
const
char
*
psz
);
/*****************************************************************************
* Import_podcast: main import function
...
...
@@ -317,6 +318,11 @@ static int Demux( demux_t *p_demux )
ADD_INFO
(
"Podcast Summary"
,
psz_item_summary
);
ADD_INFO
(
"Podcast Type"
,
psz_item_type
);
#undef ADD_INFO
/* Set the duration if available */
if
(
psz_item_duration
)
input_item_SetDuration
(
p_input
,
strTimeToMTime
(
psz_item_duration
)
);
if
(
psz_item_size
)
{
input_item_AddInfo
(
p_input
,
...
...
@@ -368,3 +374,18 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
VLC_UNUSED
(
p_demux
);
VLC_UNUSED
(
i_query
);
VLC_UNUSED
(
args
);
return
VLC_EGENERIC
;
}
static
mtime_t
strTimeToMTime
(
const
char
*
psz
)
{
int
h
,
m
,
s
;
switch
(
sscanf
(
psz
,
"%u:%u:%u"
,
&
h
,
&
m
,
&
s
)
)
{
case
3
:
return
(
mtime_t
)(
(
h
*
60
+
m
)
*
60
+
s
)
*
1000000
;
case
2
:
return
(
mtime_t
)(
h
*
60
+
m
)
*
1000000
;
break
;
default:
return
-
1
;
}
}
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