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
2e3ce1cc
Commit
2e3ce1cc
authored
Mar 30, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epg: narrow input lock
parent
41e32860
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
modules/gui/qt4/components/epg/EPGWidget.cpp
modules/gui/qt4/components/epg/EPGWidget.cpp
+15
-6
modules/gui/qt4/components/epg/EPGWidget.hpp
modules/gui/qt4/components/epg/EPGWidget.hpp
+1
-1
modules/gui/qt4/dialogs/epg.cpp
modules/gui/qt4/dialogs/epg.cpp
+2
-9
No files found.
modules/gui/qt4/components/epg/EPGWidget.cpp
View file @
2e3ce1cc
...
...
@@ -33,6 +33,9 @@
#include <QLabel>
#include <QStringList>
#include "qt4.hpp"
#include "input_manager.hpp"
#include <vlc_common.h>
#include <vlc_epg.h>
EPGWidget
::
EPGWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
...
...
@@ -94,18 +97,22 @@ void EPGWidget::setZoom( int level )
m_rulerWidget
->
setScale
(
scale
);
}
void
EPGWidget
::
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
,
uint8_t
i_input_type
)
void
EPGWidget
::
updateEPG
(
input_item_t
*
p_input_item
)
{
if
(
!
p_input_item
)
return
;
/* flush our EPG data if input type has changed */
if
(
b_input_type_known
&&
i_input
_type
!=
i_event_source_type
)
m_epgView
->
reset
();
i_event_source_type
=
i_input
_type
;
if
(
b_input_type_known
&&
p_input_item
->
i
_type
!=
i_event_source_type
)
m_epgView
->
reset
();
i_event_source_type
=
p_input_item
->
i
_type
;
b_input_type_known
=
true
;
m_epgView
->
cleanup
();
/* expire items and flags */
for
(
int
i
=
0
;
i
<
i_epg
;
++
i
)
/* Fixme: input could have dissapeared */
vlc_mutex_lock
(
&
p_input_item
->
lock
);
int
i_nbitems
=
p_input_item
->
i_epg
;
for
(
int
i
=
0
;
i
<
p_input_item
->
i_epg
;
++
i
)
{
vlc_epg_t
*
p_epg
=
pp_epg
[
i
];
vlc_epg_t
*
p_epg
=
p
_input_item
->
p
p_epg
[
i
];
/* Read current epg events from libvlc and try to insert them */
for
(
int
j
=
0
;
j
<
p_epg
->
i_event
;
++
j
)
...
...
@@ -115,6 +122,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
(
p_epg
->
p_current
==
p_event
)
);
}
}
vlc_mutex_unlock
(
&
p_input_item
->
lock
);
/* toggle our widget view */
rootWidget
->
setCurrentIndex
(
m_epgView
->
hasValidData
()
?
0
:
1
);
...
...
@@ -123,3 +131,4 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
m_epgView
->
updateDuration
();
m_epgView
->
updateStartTime
();
}
modules/gui/qt4/components/epg/EPGWidget.hpp
View file @
2e3ce1cc
...
...
@@ -46,7 +46,7 @@ public:
public
slots
:
void
setZoom
(
int
level
);
void
updateEPG
(
vlc_epg_t
**
pp_epg
,
int
i_epg
,
uint8_t
i_input_type
);
void
updateEPG
(
input_item_t
*
);
private:
EPGRuler
*
m_rulerWidget
;
...
...
modules/gui/qt4/dialogs/epg.cpp
View file @
2e3ce1cc
...
...
@@ -118,15 +118,8 @@ void EpgDialog::showEvent( EPGItem *epgItem )
void
EpgDialog
::
updateInfos
()
{
if
(
!
THEMIM
->
getInput
()
)
return
;
timer
->
stop
();
input_item_t
*
p_input_item
=
input_GetItem
(
THEMIM
->
getInput
()
);
vlc_mutex_lock
(
&
p_input_item
->
lock
);
int
i_nbitems
=
p_input_item
->
i_epg
;
if
(
i_nbitems
>
0
)
msg_Dbg
(
p_intf
,
"Found %i EPG items"
,
i_nbitems
);
epg
->
updateEPG
(
p_input_item
->
pp_epg
,
p_input_item
->
i_epg
,
p_input_item
->
i_type
);
vlc_mutex_unlock
(
&
p_input_item
->
lock
);
if
(
!
THEMIM
->
getInput
()
)
return
;
epg
->
updateEPG
(
input_GetItem
(
THEMIM
->
getInput
()
)
);
if
(
isVisible
()
)
timer
->
start
();
}
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