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
5423c650
Commit
5423c650
authored
Feb 15, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bunch of bugs in the MSN plugin (duplicated in the Growl plugin)
parent
e1c2a990
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
20 deletions
+56
-20
modules/misc/growl.c
modules/misc/growl.c
+27
-7
modules/misc/msn.c
modules/misc/msn.c
+29
-13
No files found.
modules/misc/growl.c
View file @
5423c650
...
...
@@ -99,7 +99,7 @@ static int Open( vlc_object_t *p_this )
if
(
!
p_playlist
)
{
msg_Err
(
p_intf
,
"could not find playlist object"
);
return
-
1
;
return
VLC_ENOOBJ
;
}
var_AddCallback
(
p_playlist
,
"playlist-current"
,
ItemChange
,
p_intf
);
...
...
@@ -108,7 +108,7 @@ static int Open( vlc_object_t *p_this )
RegisterToGrowl
(
p_this
);
p_intf
->
pf_run
=
Run
;
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -116,6 +116,17 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
)
{
var_DelCallback
(
p_playlist
,
"playlist-current"
,
ItemChange
,
p_this
);
vlc_object_release
(
p_playlist
);
return
VLC_EGENERIC
;
}
}
/*****************************************************************************
...
...
@@ -133,23 +144,32 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
char
psz_tmp
[
GROWL_MAX_LENGTH
];
playlist_t
*
p_playlist
;
char
*
psz_title
=
NULL
;
char
*
psz_artist
=
NULL
;
char
*
psz_album
=
NULL
;
input_thread_t
*
p_input
;
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
return
VLC_EGENERIC
;
p_input
=
p_playlist
->
p_input
;
vlc_object_release
(
p_playlist
);
if
(
!
p_input
)
return
VLC_SUCCESS
;
vlc_object_yield
(
p_input
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
||
p_input
->
b_dead
||
!
p_input
->
input
.
p_item
->
psz_name
)
if
(
p_input
->
b_dead
||
!
p_input
->
input
.
p_item
->
psz_name
)
{
/* Not playing anything ... */
vlc_object_release
(
p_input
);
return
VLC_SUCCESS
;
}
/* Playing something ... */
psz_artist
=
vlc_input_item_GetInfo
(
p_input
->
input
.
p_item
,
_
(
"Meta-information"
),
VLC_META_ARTIST
);
_
(
VLC_META_ARTIST
)
);
psz_album
=
vlc_input_item_GetInfo
(
p_input
->
input
.
p_item
,
_
(
"Meta-information"
),
_
(
"Album/movie/show title"
)
);
...
...
modules/misc/msn.c
View file @
5423c650
...
...
@@ -93,10 +93,6 @@ static int Open( vlc_object_t *p_this )
return
-
1
;
}
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
p_intf
->
p_sys
->
psz_format
=
config_GetPsz
(
p_intf
,
"msn-format"
);
if
(
!
p_intf
->
p_sys
->
psz_format
)
{
...
...
@@ -105,12 +101,15 @@ static int Open( vlc_object_t *p_this )
}
msg_Dbg
(
p_intf
,
"using format: %s"
,
p_intf
->
p_sys
->
psz_format
);
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
{
msg_Err
(
p_intf
,
"could not find playlist object"
);
free
(
p_intf
->
p_sys
->
psz_format
);
free
(
p_intf
->
p_sys
);
return
-
1
;
return
VLC_ENOOBJ
;
}
var_AddCallback
(
p_playlist
,
"item-change"
,
ItemChange
,
p_intf
);
...
...
@@ -118,7 +117,7 @@ static int Open( vlc_object_t *p_this )
p_intf
->
pf_run
=
Run
;
return
0
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -127,11 +126,19 @@ static int Open( vlc_object_t *p_this )
static
void
Close
(
vlc_object_t
*
p_this
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
/* clear the MSN stuff ... else it looks like we're still playing
* something although VLC (or the MSN plugin) is closed */
SendToMSN
(
"
\\
0Music
\\
01
\\
0
\\
0
\\
0
\\
0
\\
0
\\
0
\\
0"
);
if
(
p_playlist
)
{
var_DellCallback
(
p_playlist
,
"playlist-current"
,
ItemChange
,
p_intf
);
}
/* Destroy structure */
free
(
p_intf
->
p_sys
->
psz_format
);
free
(
p_intf
->
p_sys
);
...
...
@@ -152,33 +159,42 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
playlist_t
*
p_playlist
;
char
psz_tmp
[
MSN_MAX_LENGTH
];
char
*
psz_title
=
NULL
;
char
*
psz_artist
=
NULL
;
char
*
psz_album
=
NULL
;
input_thread_t
*
p_input
;
int
i
,
j
;
if
(
!
p_intf
->
p_sys
)
return
VLC_SUCCESS
;
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
||
p_input
->
b_dead
||
!
p_input
->
input
.
p_item
->
psz_name
)
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
return
VLC_EGENERIC
;
p_input
=
p_playlist
->
p_input
;
vlc_object_release
(
p_playlist
);
if
(
!
p_input
)
return
VLC_SUCCESS
;
vlc_object_yield
(
p_input
);
if
(
p_input
->
b_dead
||
!
p_input
->
input
.
p_item
->
psz_name
)
{
/* Not playing anything ... */
SendToMSN
(
"
\\
0Music
\\
01
\\
0
\\
0
\\
0
\\
0
\\
0
\\
0
\\
0"
);
vlc_object_release
(
p_input
);
return
VLC_SUCCESS
;
}
/* Playing something ... */
psz_artist
=
vlc_input_item_GetInfo
(
p_input
->
input
.
p_item
,
_
(
"Meta-information"
),
VLC_META_ARTIST
);
_
(
VLC_META_ARTIST
)
);
psz_album
=
vlc_input_item_GetInfo
(
p_input
->
input
.
p_item
,
_
(
"Meta-information"
),
_
(
"Album/movie/show title"
)
);
_
(
"Album/movie/show title"
)
);
psz_title
=
strdup
(
p_input
->
input
.
p_item
->
psz_name
);
if
(
psz_title
==
NULL
)
psz_title
=
strdup
(
N_
(
"(no title)"
)
);
if
(
psz_artist
==
NULL
)
psz_artist
=
strdup
(
N_
(
"(no artist)"
)
);
...
...
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