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
02e878a1
Commit
02e878a1
authored
May 20, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use var_CountChoices instead of var_Change(VLC_VAR_GETCHOICES) when applicable.
parent
adf4fbbf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
51 deletions
+19
-51
modules/control/rc.c
modules/control/rc.c
+6
-14
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+4
-12
modules/gui/ncurses.c
modules/gui/ncurses.c
+6
-13
src/control/audio.c
src/control/audio.c
+1
-4
src/control/video.c
src/control/video.c
+2
-8
No files found.
modules/control/rc.c
View file @
02e878a1
...
...
@@ -1145,15 +1145,11 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else
{
vlc_value_t
val_list
;
/* Get. */
var_Get
(
p_input
,
"chapter"
,
&
val
);
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
msg_rc
(
"Currently playing chapter %d/%d."
,
val
.
i_int
,
val_list
.
p_list
->
i_count
);
var_FreeList
(
&
val_list
,
NULL
);
int
i_chapter_count
=
var_CountChoices
(
p_input
,
"chapter"
);
msg_rc
(
"Currently playing chapter %d/%d."
,
val
.
i_int
,
i_chapter_count
);
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"chapter_n"
)
)
...
...
@@ -1177,15 +1173,11 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else
{
vlc_value_t
val_list
;
/* Get. */
var_Get
(
p_input
,
"title"
,
&
val
);
var_Change
(
p_input
,
"title"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
msg_rc
(
"Currently playing title %d/%d."
,
val
.
i_int
,
val_list
.
p_list
->
i_count
);
var_FreeList
(
&
val_list
,
NULL
);
int
i_title_count
=
var_CountChoices
(
p_input
,
"title"
);
msg_rc
(
"Currently playing title %d/%d."
,
val
.
i_int
,
i_title_count
);
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"title_n"
)
)
...
...
modules/gui/beos/InterfaceWindow.cpp
View file @
02e878a1
...
...
@@ -662,34 +662,26 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case
NAVIGATE_NEXT
:
if
(
p_input
)
{
vlc_value_t
val
,
val_list
;
/* First try to go to next chapter */
if
(
!
var_Get
(
p_input
,
"chapter"
,
&
val
)
)
{
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
if
(
val_list
.
p_list
->
i_count
>
val
.
i_int
)
int
i_chapter_count
=
var_CountChoices
(
p_input
,
"chapter"
);
if
(
i_chapter_count
>
val
.
i_int
)
{
var_FreeList
(
&
val_list
,
NULL
);
var_SetVoid
(
p_input
,
"next-chapter"
);
break
;
}
var_FreeList
(
&
val_list
,
NULL
);
}
/* Try to go to next title */
if
(
!
var_Get
(
p_input
,
"title"
,
&
val
)
)
{
var_Change
(
p_input
,
"title"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
if
(
val_list
.
p_list
->
i_count
>
val
.
i_int
)
int
i_title_count
=
var_CountChoices
(
p_input
,
"title"
);
if
(
i_title_count
>
val
.
i_int
)
{
var_FreeList
(
&
val_list
,
NULL
);
var_SetVoid
(
p_input
,
"next-title"
);
break
;
}
var_FreeList
(
&
val_list
,
NULL
);
}
/* Try to go to next file */
...
...
modules/gui/ncurses.c
View file @
02e878a1
...
...
@@ -1512,7 +1512,6 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
char
buf1
[
MSTRTIME_MAX_SIZE
];
char
buf2
[
MSTRTIME_MAX_SIZE
];
vlc_value_t
val
;
vlc_value_t
val_list
;
/* Source */
char
*
psz_uri
=
input_item_GetURI
(
input_GetItem
(
p_input
)
);
...
...
@@ -1554,23 +1553,17 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
/* Title */
if
(
!
var_Get
(
p_input
,
"title"
,
&
val
)
)
{
var_Change
(
p_input
,
"title"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
if
(
val_list
.
p_list
->
i_count
>
0
)
{
mvnprintw
(
y
++
,
0
,
COLS
,
_
(
" Title : %d/%d"
),
val
.
i_int
,
val_list
.
p_list
->
i_count
);
}
var_FreeList
(
&
val_list
,
NULL
);
int
i_title_count
=
var_CountChoices
(
p_input
,
"title"
);
if
(
i_title_count
>
0
)
mvnprintw
(
y
++
,
0
,
COLS
,
_
(
" Title : %d/%d"
),
val
.
i_int
,
i_title_count
);
}
/* Chapter */
if
(
!
var_Get
(
p_input
,
"chapter"
,
&
val
)
)
{
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
if
(
val_list
.
p_list
->
i_count
>
0
)
{
mvnprintw
(
y
++
,
0
,
COLS
,
_
(
" Chapter : %d/%d"
),
val
.
i_int
,
val_list
.
p_list
->
i_count
);
}
var_FreeList
(
&
val_list
,
NULL
);
int
i_chapter_count
=
var_CountChoices
(
p_input
,
"chapter"
);
if
(
i_chapter_count
>
0
)
mvnprintw
(
y
++
,
0
,
COLS
,
_
(
" Chapter : %d/%d"
),
val
.
i_int
,
i_chapter_count
);
}
}
else
...
...
src/control/audio.c
View file @
02e878a1
...
...
@@ -372,15 +372,12 @@ int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi,
libvlc_exception_t
*
p_e
)
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
,
p_e
);
vlc_value_t
val_list
;
int
i_track_count
;
if
(
!
p_input_thread
)
return
-
1
;
var_Change
(
p_input_thread
,
"audio-es"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
i_track_count
=
val_list
.
p_list
->
i_count
;
var_FreeList
(
&
val_list
,
NULL
);
i_track_count
=
var_CountChoices
(
p_input_thread
,
"audio-es"
);
vlc_object_release
(
p_input_thread
);
return
i_track_count
;
...
...
src/control/video.c
View file @
02e878a1
...
...
@@ -281,15 +281,12 @@ int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi,
libvlc_exception_t
*
p_e
)
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
,
p_e
);
vlc_value_t
val_list
;
int
i_spu_count
;
if
(
!
p_input_thread
)
return
-
1
;
var_Change
(
p_input_thread
,
"spu-es"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
i_spu_count
=
val_list
.
p_list
->
i_count
;
var_FreeList
(
&
val_list
,
NULL
);
i_spu_count
=
var_CountChoices
(
p_input_thread
,
"spu-es"
);
vlc_object_release
(
p_input_thread
);
return
i_spu_count
;
...
...
@@ -506,15 +503,12 @@ int libvlc_video_get_track_count( libvlc_media_player_t *p_mi,
libvlc_exception_t
*
p_e
)
{
input_thread_t
*
p_input_thread
=
libvlc_get_input_thread
(
p_mi
,
p_e
);
vlc_value_t
val_list
;
int
i_track_count
;
if
(
!
p_input_thread
)
return
-
1
;
var_Change
(
p_input_thread
,
"video-es"
,
VLC_VAR_GETCHOICES
,
&
val_list
,
NULL
);
i_track_count
=
val_list
.
p_list
->
i_count
;
var_FreeList
(
&
val_list
,
NULL
);
i_track_count
=
var_CountChoices
(
p_input_thread
,
"video-es"
);
vlc_object_release
(
p_input_thread
);
return
i_track_count
;
...
...
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