Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8ce688cb
Commit
8ce688cb
authored
Jan 17, 2003
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./modules/gui/ncurses/ncurses.c: added locks and checks in navigation code.
parent
c39a74a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
25 deletions
+42
-25
modules/gui/ncurses/ncurses.c
modules/gui/ncurses/ncurses.c
+42
-25
No files found.
modules/gui/ncurses/ncurses.c
View file @
8ce688cb
/*****************************************************************************
* ncurses.c : NCurses plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ncurses.c,v 1.
2 2002/08/08 22:28:22
sam Exp $
* Copyright (C) 2001
, 2002, 2003
VideoLAN
* $Id: ncurses.c,v 1.
3 2003/01/17 19:36:53
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -92,7 +92,7 @@ static int Open( vlc_object_t *p_this )
if
(
p_intf
->
p_sys
==
NULL
)
{
msg_Err
(
p_intf
,
"out of memory"
);
return
(
1
)
;
return
VLC_ENOMEM
;
}
p_intf
->
p_sys
->
p_input
=
NULL
;
...
...
@@ -113,7 +113,7 @@ static int Open( vlc_object_t *p_this )
clear
();
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -273,7 +273,7 @@ static int PrintFullLine ( const char *p_fmt, ... )
if
(
p_buf
==
NULL
)
{
return
(
-
1
)
;
return
-
1
;
}
i_len
=
strlen
(
p_buf
);
...
...
@@ -505,20 +505,22 @@ static void Stop ( intf_thread_t *p_intf )
static
void
Next
(
intf_thread_t
*
p_intf
)
{
int
i_id
;
input_area_t
*
p_area
;
int
i_id
;
i_id
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
i_id
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
if
(
i_id
<
p_intf
->
p_sys
->
p_input
->
stream
.
i_area_nb
)
{
p_area
=
p_intf
->
p_sys
->
p_input
->
stream
.
pp_areas
[
i_id
];
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
(
input_area_t
*
)
p_area
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
p_area
);
input_SetStatus
(
p_intf
->
p_sys
->
p_input
,
INPUT_STATUS_PLAY
);
}
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
}
static
void
ManageSlider
(
intf_thread_t
*
p_intf
)
...
...
@@ -569,16 +571,19 @@ static void PrevTitle ( intf_thread_t *p_intf )
input_area_t
*
p_area
;
int
i_id
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
i_id
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
->
i_id
-
1
;
/* Disallow area 0 since it is used for video_ts.vob */
if
(
i_id
>
0
)
{
p_area
=
p_intf
->
p_sys
->
p_input
->
stream
.
pp_areas
[
i_id
];
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
(
input_area_t
*
)
p_area
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
p_area
);
input_SetStatus
(
p_intf
->
p_sys
->
p_input
,
INPUT_STATUS_PLAY
);
}
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
}
static
void
NextTitle
(
intf_thread_t
*
p_intf
)
...
...
@@ -586,44 +591,56 @@ static void NextTitle ( intf_thread_t *p_intf )
input_area_t
*
p_area
;
int
i_id
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
i_id
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
->
i_id
+
1
;
if
(
i_id
<
p_intf
->
p_sys
->
p_input
->
stream
.
i_area_nb
)
{
p_area
=
p_intf
->
p_sys
->
p_input
->
stream
.
pp_areas
[
i_id
];
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
(
input_area_t
*
)
p_area
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
p_area
);
input_SetStatus
(
p_intf
->
p_sys
->
p_input
,
INPUT_STATUS_PLAY
);
}
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
}
static
void
PrevChapter
(
intf_thread_t
*
p_intf
)
{
input_area_t
*
p_area
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
p_area
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
;
if
(
p_area
->
i_part
>
0
)
{
p_area
->
i_part
--
;
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
(
input_area_t
*
)
p_area
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
p_area
);
input_SetStatus
(
p_intf
->
p_sys
->
p_input
,
INPUT_STATUS_PLAY
);
}
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
}
static
void
NextChapter
(
intf_thread_t
*
p_intf
)
{
input_area_t
*
p_area
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
p_area
=
p_intf
->
p_sys
->
p_input
->
stream
.
p_selected_area
;
if
(
p_area
->
i_part
<
p_area
->
i_part_nb
)
{
p_area
->
i_part
++
;
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
(
input_area_t
*
)
p_area
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
input_ChangeArea
(
p_intf
->
p_sys
->
p_input
,
p_area
);
input_SetStatus
(
p_intf
->
p_sys
->
p_input
,
INPUT_STATUS_PLAY
);
}
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
p_input
->
stream
.
stream_lock
);
}
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