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
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
Hide 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>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -40,9 +40,9 @@
* Local prototypes.
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Run
(
intf_thread_t
*
);
static
void
Run
(
intf_thread_t
*
);
static
void
FullScreen
(
intf_thread_t
*
);
static
void
Play
(
intf_thread_t
*
);
static
void
Stop
(
intf_thread_t
*
);
...
...
@@ -84,7 +84,7 @@ struct intf_sys_t
* Open: initialize and create window
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
p_this
)
{
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
/* Allocate instance and initialize some members */
...
...
@@ -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,14 +113,14 @@ static int Open( vlc_object_t *p_this )
clear
();
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Close: destroy interface window
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
if
(
p_intf
->
p_sys
->
p_input
)
...
...
@@ -152,7 +152,7 @@ static void Run( intf_thread_t *p_intf )
{
msleep
(
INTF_IDLE_SLEEP
);
/* Update the input */
/* Update the input */
if
(
p_intf
->
p_sys
->
p_input
==
NULL
)
{
p_intf
->
p_sys
->
p_input
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
...
...
@@ -163,7 +163,7 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release
(
p_intf
->
p_sys
->
p_input
);
p_intf
->
p_sys
->
p_input
=
NULL
;
}
while
(
(
i_key
=
getch
())
!=
-
1
)
{
/*
...
...
@@ -273,7 +273,7 @@ static int PrintFullLine ( const char *p_fmt, ... )
if
(
p_buf
==
NULL
)
{
return
(
-
1
)
;
return
-
1
;
}
i_len
=
strlen
(
p_buf
);
...
...
@@ -379,10 +379,10 @@ static void Eject ( intf_thread_t *p_intf )
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
if
(
p_playlist
->
i_index
<
0
)
{
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_object_release
(
p_playlist
);
return
;
return
;
}
psz_name
=
p_playlist
->
pp_items
[
p_playlist
->
i_index
]
->
psz_name
;
...
...
@@ -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