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
f1dd5a85
Commit
f1dd5a85
authored
Jan 16, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Codingstyle fixes
parent
19713fc4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
51 deletions
+38
-51
src/control/mediacontrol_core.c
src/control/mediacontrol_core.c
+38
-51
No files found.
src/control/mediacontrol_core.c
View file @
f1dd5a85
...
@@ -57,12 +57,10 @@
...
@@ -57,12 +57,10 @@
#define RAISE( c, m ) exception->code = c; \
#define RAISE( c, m ) exception->code = c; \
exception->message = strdup(m);
exception->message = strdup(m);
vlc_t
*
vlc_current_object
(
int
);
mediacontrol_Instance
*
mediacontrol_new_from_object
(
int
vlc_object_id
,
mediacontrol_Instance
*
mediacontrol_new_from_object
(
int
vlc_object_id
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_Instance
*
retval
;
mediacontrol_Instance
*
retval
=
NULL
;
vlc_object_t
*
p_vlc
;
vlc_object_t
*
p_vlc
;
vlc_object_t
*
p_object
;
vlc_object_t
*
p_object
;
...
@@ -106,7 +104,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
...
@@ -106,7 +104,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
const
mediacontrol_PositionKey
a_key
,
const
mediacontrol_PositionKey
a_key
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_Position
*
retval
;
mediacontrol_Position
*
retval
=
NULL
;
vlc_value_t
val
;
vlc_value_t
val
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
...
@@ -154,18 +152,16 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
...
@@ -154,18 +152,16 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
if
(
!
p_input
)
if
(
!
p_input
)
{
{
RAISE
(
mediacontrol_InternalException
,
"No input thread."
);
RAISE
(
mediacontrol_InternalException
,
"No input thread."
);
return
;
}
}
else
if
(
!
var_GetBool
(
p_input
,
"seekable"
)
)
if
(
!
var_GetBool
(
p_input
,
"seekable"
)
)
{
{
RAISE
(
mediacontrol_InvalidPosition
,
"Stream not seekable"
);
RAISE
(
mediacontrol_InvalidPosition
,
"Stream not seekable"
);
return
;
}
}
else
{
val
.
i_time
=
mediacontrol_position2microsecond
(
p_input
,
a_position
);
val
.
i_time
=
mediacontrol_position2microsecond
(
p_input
,
a_position
);
var_Set
(
p_input
,
"time"
,
val
);
var_Set
(
p_input
,
"time"
,
val
);
return
;
}
}
}
/* Starts playing a stream */
/* Starts playing a stream */
...
@@ -197,8 +193,11 @@ mediacontrol_start( mediacontrol_Instance *self,
...
@@ -197,8 +193,11 @@ mediacontrol_start( mediacontrol_Instance *self,
{
{
int
i_index
;
int
i_index
;
int
i_from
;
int
i_from
;
char
*
psz_from
=
(
char
*
)
malloc
(
20
*
sizeof
(
char
)
)
;
char
*
psz_from
=
NULL
;
psz_from
=
(
char
*
)
malloc
(
20
*
sizeof
(
char
)
);
if
(
psz_from
)
{
i_from
=
mediacontrol_position2microsecond
(
p_playlist
->
p_input
,
a_position
)
/
1000000
;
i_from
=
mediacontrol_position2microsecond
(
p_playlist
->
p_input
,
a_position
)
/
1000000
;
i_index
=
p_playlist
->
i_index
;
i_index
=
p_playlist
->
i_index
;
...
@@ -212,9 +211,9 @@ mediacontrol_start( mediacontrol_Instance *self,
...
@@ -212,9 +211,9 @@ mediacontrol_start( mediacontrol_Instance *self,
snprintf
(
psz_from
,
20
,
"start-time=%i"
,
i_from
);
snprintf
(
psz_from
,
20
,
"start-time=%i"
,
i_from
);
playlist_ItemAddOption
(
p_playlist
->
pp_items
[
i_index
],
psz_from
);
playlist_ItemAddOption
(
p_playlist
->
pp_items
[
i_index
],
psz_from
);
free
(
psz_from
);
free
(
psz_from
);
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
playlist_Play
(
p_playlist
);
playlist_Play
(
p_playlist
);
}
}
else
else
...
@@ -222,8 +221,6 @@ mediacontrol_start( mediacontrol_Instance *self,
...
@@ -222,8 +221,6 @@ mediacontrol_start( mediacontrol_Instance *self,
RAISE
(
mediacontrol_PlaylistException
,
"Empty playlist."
);
RAISE
(
mediacontrol_PlaylistException
,
"Empty playlist."
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
}
}
return
;
}
}
void
void
...
@@ -243,8 +240,6 @@ mediacontrol_pause( mediacontrol_Instance *self,
...
@@ -243,8 +240,6 @@ mediacontrol_pause( mediacontrol_Instance *self,
{
{
RAISE
(
mediacontrol_InternalException
,
"No input"
);
RAISE
(
mediacontrol_InternalException
,
"No input"
);
}
}
return
;
}
}
void
void
...
@@ -276,9 +271,8 @@ mediacontrol_stop( mediacontrol_Instance *self,
...
@@ -276,9 +271,8 @@ mediacontrol_stop( mediacontrol_Instance *self,
if
(
!
self
->
p_playlist
)
if
(
!
self
->
p_playlist
)
{
{
RAISE
(
mediacontrol_PlaylistException
,
"No playlist"
);
RAISE
(
mediacontrol_PlaylistException
,
"No playlist"
);
return
;
}
}
else
playlist_Stop
(
self
->
p_playlist
);
playlist_Stop
(
self
->
p_playlist
);
}
}
...
@@ -295,9 +289,8 @@ mediacontrol_playlist_add_item( mediacontrol_Instance *self,
...
@@ -295,9 +289,8 @@ mediacontrol_playlist_add_item( mediacontrol_Instance *self,
if
(
!
self
->
p_playlist
)
if
(
!
self
->
p_playlist
)
{
{
RAISE
(
mediacontrol_InternalException
,
"No playlist"
);
RAISE
(
mediacontrol_InternalException
,
"No playlist"
);
return
;
}
}
else
playlist_Add
(
self
->
p_playlist
,
psz_file
,
psz_file
,
PLAYLIST_INSERT
,
playlist_Add
(
self
->
p_playlist
,
psz_file
,
psz_file
,
PLAYLIST_INSERT
,
PLAYLIST_END
);
PLAYLIST_END
);
}
}
...
@@ -310,12 +303,9 @@ mediacontrol_playlist_next_item( mediacontrol_Instance *self,
...
@@ -310,12 +303,9 @@ mediacontrol_playlist_next_item( mediacontrol_Instance *self,
if
(
!
self
->
p_playlist
)
if
(
!
self
->
p_playlist
)
{
{
RAISE
(
mediacontrol_InternalException
,
"No playlist"
);
RAISE
(
mediacontrol_InternalException
,
"No playlist"
);
return
;
}
}
else
playlist_Next
(
self
->
p_playlist
);
playlist_Next
(
self
->
p_playlist
);
return
;
}
}
void
void
...
@@ -326,19 +316,16 @@ mediacontrol_playlist_clear( mediacontrol_Instance *self,
...
@@ -326,19 +316,16 @@ mediacontrol_playlist_clear( mediacontrol_Instance *self,
if
(
!
self
->
p_playlist
)
if
(
!
self
->
p_playlist
)
{
{
RAISE
(
mediacontrol_PlaylistException
,
"No playlist"
);
RAISE
(
mediacontrol_PlaylistException
,
"No playlist"
);
return
;
}
}
else
playlist_Clear
(
self
->
p_playlist
);
playlist_Clear
(
self
->
p_playlist
);
return
;
}
}
mediacontrol_PlaylistSeq
*
mediacontrol_PlaylistSeq
*
mediacontrol_playlist_get_list
(
mediacontrol_Instance
*
self
,
mediacontrol_playlist_get_list
(
mediacontrol_Instance
*
self
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_PlaylistSeq
*
retval
;
mediacontrol_PlaylistSeq
*
retval
=
NULL
;
int
i_index
;
int
i_index
;
playlist_t
*
p_playlist
=
self
->
p_playlist
;
playlist_t
*
p_playlist
=
self
->
p_playlist
;
int
i_playlist_size
;
int
i_playlist_size
;
...
@@ -373,7 +360,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
...
@@ -373,7 +360,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
mediacontrol_PositionKey
a_key
,
mediacontrol_PositionKey
a_key
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_StreamInformation
*
retval
;
mediacontrol_StreamInformation
*
retval
=
NULL
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
vlc_value_t
val
;
vlc_value_t
val
;
...
...
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