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
feab3bbb
Commit
feab3bbb
authored
Mar 21, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created input_item_SetEpg function.
parent
b382aefa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
29 deletions
+41
-29
src/input/es_out.c
src/input/es_out.c
+8
-29
src/input/input_interface.h
src/input/input_interface.h
+2
-0
src/input/item.c
src/input/item.c
+31
-0
No files found.
src/input/es_out.c
View file @
feab3bbb
...
@@ -1266,7 +1266,6 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
...
@@ -1266,7 +1266,6 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
input_thread_t
*
p_input
=
p_sys
->
p_input
;
input_thread_t
*
p_input
=
p_sys
->
p_input
;
es_out_pgrm_t
*
p_pgrm
;
es_out_pgrm_t
*
p_pgrm
;
char
*
psz_cat
;
char
*
psz_cat
;
int
i
;
/* Find program */
/* Find program */
p_pgrm
=
EsOutProgramFind
(
out
,
i_group
);
p_pgrm
=
EsOutProgramFind
(
out
,
i_group
);
...
@@ -1279,37 +1278,17 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
...
@@ -1279,37 +1278,17 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
vlc_epg_Merge
(
p_pgrm
->
p_epg
,
p_epg
);
vlc_epg_Merge
(
p_pgrm
->
p_epg
,
p_epg
);
/* Update info */
/* Update info */
msg_Dbg
(
p_input
,
"EsOutProgramEpg: number=%d name=%s"
,
i_group
,
p_pgrm
->
p_epg
->
psz_name
);
psz_cat
=
EsOutProgramGetMetaName
(
p_pgrm
);
psz_cat
=
EsOutProgramGetMetaName
(
p_pgrm
);
#ifdef HAVE_LOCALTIME_R
char
*
psz_epg
;
char
*
psz_epg
;
if
(
asprintf
(
&
psz_epg
,
"EPG %s"
,
psz_cat
)
==
-
1
)
if
(
asprintf
(
&
psz_epg
,
"EPG %s"
,
psz_cat
)
>=
0
)
psz_epg
=
NULL
;
{
input_Control
(
p_input
,
INPUT_DEL_INFO
,
psz_epg
,
NULL
);
input_item_SetEpg
(
p_input
->
p
->
p_item
,
psz_epg
,
p_pgrm
->
p_epg
);
msg_Dbg
(
p_input
,
"EsOutProgramEpg: number=%d name=%s"
,
i_group
,
p_pgrm
->
p_epg
->
psz_name
);
for
(
i
=
0
;
i
<
p_pgrm
->
p_epg
->
i_event
;
i
++
)
{
const
vlc_epg_event_t
*
p_evt
=
p_pgrm
->
p_epg
->
pp_event
[
i
];
time_t
t_start
=
(
time_t
)
p_evt
->
i_start
;
struct
tm
tm_start
;
char
psz_start
[
128
];
localtime_r
(
&
t_start
,
&
tm_start
);
snprintf
(
psz_start
,
sizeof
(
psz_start
),
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d"
,
1900
+
tm_start
.
tm_year
,
1
+
tm_start
.
tm_mon
,
tm_start
.
tm_mday
,
tm_start
.
tm_hour
,
tm_start
.
tm_min
,
tm_start
.
tm_sec
);
if
(
p_evt
->
psz_short_description
||
p_evt
->
psz_description
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_epg
,
psz_start
,
"%s (%2.2d:%2.2d) - %s"
,
p_evt
->
psz_name
,
p_evt
->
i_duration
/
60
/
60
,
(
p_evt
->
i_duration
/
60
)
%
60
,
p_evt
->
psz_short_description
?
p_evt
->
psz_short_description
:
p_evt
->
psz_description
);
else
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_epg
,
psz_start
,
"%s (%2.2d:%2.2d)"
,
p_evt
->
psz_name
,
p_evt
->
i_duration
/
60
/
60
,
(
p_evt
->
i_duration
/
60
)
%
60
);
}
free
(
psz_epg
);
free
(
psz_epg
);
#endif
}
/* Update now playing */
/* Update now playing */
free
(
p_pgrm
->
psz_now_playing
);
free
(
p_pgrm
->
psz_now_playing
);
p_pgrm
->
psz_now_playing
=
NULL
;
p_pgrm
->
psz_now_playing
=
NULL
;
...
...
src/input/input_interface.h
View file @
feab3bbb
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
void
input_item_SetPreparsed
(
input_item_t
*
p_i
,
bool
b_preparsed
);
void
input_item_SetPreparsed
(
input_item_t
*
p_i
,
bool
b_preparsed
);
void
input_item_SetArtNotFound
(
input_item_t
*
p_i
,
bool
b_not_found
);
void
input_item_SetArtNotFound
(
input_item_t
*
p_i
,
bool
b_not_found
);
void
input_item_SetArtFetched
(
input_item_t
*
p_i
,
bool
b_art_fetched
);
void
input_item_SetArtFetched
(
input_item_t
*
p_i
,
bool
b_art_fetched
);
void
input_item_SetEpg
(
input_item_t
*
p_item
,
const
char
*
psz_epg
,
const
vlc_epg_t
*
p_epg
);
int
input_Preparse
(
vlc_object_t
*
,
input_item_t
*
);
int
input_Preparse
(
vlc_object_t
*
,
input_item_t
*
);
...
...
src/input/item.c
View file @
feab3bbb
...
@@ -622,6 +622,37 @@ int input_item_DelInfo( input_item_t *p_i,
...
@@ -622,6 +622,37 @@ int input_item_DelInfo( input_item_t *p_i,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
void
input_item_SetEpg
(
input_item_t
*
p_item
,
const
char
*
psz_epg
,
const
vlc_epg_t
*
p_epg
)
{
input_item_DelInfo
(
p_item
,
psz_epg
,
NULL
);
#ifdef HAVE_LOCALTIME_R
for
(
int
i
=
0
;
i
<
p_epg
->
i_event
;
i
++
)
{
const
vlc_epg_event_t
*
p_evt
=
p_epg
->
pp_event
[
i
];
time_t
t_start
=
(
time_t
)
p_evt
->
i_start
;
struct
tm
tm_start
;
char
psz_start
[
128
];
localtime_r
(
&
t_start
,
&
tm_start
);
snprintf
(
psz_start
,
sizeof
(
psz_start
),
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d"
,
1900
+
tm_start
.
tm_year
,
1
+
tm_start
.
tm_mon
,
tm_start
.
tm_mday
,
tm_start
.
tm_hour
,
tm_start
.
tm_min
,
tm_start
.
tm_sec
);
if
(
p_evt
->
psz_short_description
||
p_evt
->
psz_description
)
input_item_AddInfo
(
p_item
,
psz_epg
,
psz_start
,
"%s (%2.2d:%2.2d) - %s"
,
p_evt
->
psz_name
,
p_evt
->
i_duration
/
60
/
60
,
(
p_evt
->
i_duration
/
60
)
%
60
,
p_evt
->
psz_short_description
?
p_evt
->
psz_short_description
:
p_evt
->
psz_description
);
else
input_item_AddInfo
(
p_item
,
psz_epg
,
psz_start
,
"%s (%2.2d:%2.2d)"
,
p_evt
->
psz_name
,
p_evt
->
i_duration
/
60
/
60
,
(
p_evt
->
i_duration
/
60
)
%
60
);
}
#endif
}
input_item_t
*
__input_item_NewExt
(
vlc_object_t
*
p_obj
,
const
char
*
psz_uri
,
input_item_t
*
__input_item_NewExt
(
vlc_object_t
*
p_obj
,
const
char
*
psz_uri
,
const
char
*
psz_name
,
const
char
*
psz_name
,
...
...
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