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
0a902097
Commit
0a902097
authored
Oct 27, 2010
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncurses: cosmetics to reduce LoC count (now under 2k!)
Also assume p_item->i_es is set correctly
parent
d2f7f8a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
modules/gui/ncurses.c
modules/gui/ncurses.c
+9
-21
No files found.
modules/gui/ncurses.c
View file @
0a902097
...
@@ -1116,21 +1116,13 @@ static void Redraw(intf_thread_t *p_intf, time_t *t_last_refresh)
...
@@ -1116,21 +1116,13 @@ static void Redraw(intf_thread_t *p_intf, time_t *t_last_refresh)
vlc_mutex_lock
(
&
p_item
->
lock
);
vlc_mutex_lock
(
&
p_item
->
lock
);
vlc_mutex_lock
(
&
p_item
->
p_stats
->
lock
);
vlc_mutex_lock
(
&
p_item
->
p_stats
->
lock
);
int
i_audio
=
0
;
int
i_audio
=
0
,
i_video
=
0
;
int
i_video
=
0
;
for
(
int
i
=
0
;
i
<
p_item
->
i_es
;
i
++
)
int
i
;
if
(
!
p_item
->
i_es
)
i_video
=
i_audio
=
1
;
else
for
(
i
=
0
;
i
<
p_item
->
i_es
;
i
++
)
{
{
i_audio
+=
(
p_item
->
es
[
i
]
->
i_cat
==
AUDIO_ES
);
i_audio
+=
(
p_item
->
es
[
i
]
->
i_cat
==
AUDIO_ES
);
i_video
+=
(
p_item
->
es
[
i
]
->
i_cat
==
VIDEO_ES
);
i_video
+=
(
p_item
->
es
[
i
]
->
i_cat
==
VIDEO_ES
);
}
}
int
l
=
0
;
#define SHOW_ACS(x,c) \
#define SHOW_ACS(x,c) \
if (l >= p_sys->i_box_start && l - p_sys->i_box_start < p_sys->i_box_lines) \
if (l >= p_sys->i_box_start && l - p_sys->i_box_start < p_sys->i_box_lines) \
mvaddch(p_sys->i_box_y - p_sys->i_box_start + l, x, c)
mvaddch(p_sys->i_box_y - p_sys->i_box_start + l, x, c)
...
@@ -1210,13 +1202,10 @@ if (l >= p_sys->i_box_start && l - p_sys->i_box_start < p_sys->i_box_lines) \
...
@@ -1210,13 +1202,10 @@ if (l >= p_sys->i_box_start && l - p_sys->i_box_start < p_sys->i_box_lines) \
#undef SHOW_ACS
#undef SHOW_ACS
p_sys
->
i_box_lines_total
=
l
;
p_sys
->
i_box_lines_total
=
l
;
if
(
p_sys
->
i_box_start
>
=
p_sys
->
i_box_lines_total
)
if
(
p_sys
->
i_box_start
>
p_sys
->
i_box_lines_total
-
1
)
p_sys
->
i_box_start
=
p_sys
->
i_box_lines_total
-
1
;
p_sys
->
i_box_start
=
p_sys
->
i_box_lines_total
-
1
;
if
(
l
-
p_sys
->
i_box_start
<
p_sys
->
i_box_lines
)
y
+=
__MIN
(
l
-
p_sys
->
i_box_start
,
p_sys
->
i_box_lines
);
y
+=
l
-
p_sys
->
i_box_start
;
else
y
+=
p_sys
->
i_box_lines
;
vlc_mutex_unlock
(
&
p_item
->
p_stats
->
lock
);
vlc_mutex_unlock
(
&
p_item
->
p_stats
->
lock
);
vlc_mutex_unlock
(
&
p_item
->
lock
);
vlc_mutex_unlock
(
&
p_item
->
lock
);
...
@@ -1922,8 +1911,7 @@ static void Run(intf_thread_t *p_intf)
...
@@ -1922,8 +1911,7 @@ static void Run(intf_thread_t *p_intf)
Redraw
(
p_intf
,
&
t_last_refresh
);
Redraw
(
p_intf
,
&
t_last_refresh
);
force_redraw
=
false
;
force_redraw
=
false
;
}
}
else
if
((
time
(
0
)
-
t_last_refresh
)
>=
1
)
if
((
time
(
0
)
-
t_last_refresh
)
>=
1
)
Redraw
(
p_intf
,
&
t_last_refresh
);
Redraw
(
p_intf
,
&
t_last_refresh
);
}
}
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
...
...
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