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
83ec2a0e
Commit
83ec2a0e
authored
Sep 10, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioScrobbler: cleanup and respect last.fm specifications
(and don't forgot to release object when an error occure)
parent
168562ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
+20
-17
No files found.
modules/misc/audioscrobbler.c
View file @
83ec2a0e
...
@@ -575,30 +575,31 @@ static void AddToQueue ( intf_thread_t *p_this )
...
@@ -575,30 +575,31 @@ static void AddToQueue ( intf_thread_t *p_this )
p_sys
->
time_total_pauses
;
p_sys
->
time_total_pauses
;
played_time
/=
1000000
;
/* µs → s */
played_time
/=
1000000
;
/* µs → s */
if
(
(
played_time
<
60
)
&&
/*HACK: it seam that the preparsing sometime fail,
(
played_time
<
(
p_sys
->
p_current_song
.
i_l
/
2
)
)
)
so use the playing time as the song length */
{
if
(
p_sys
->
p_current_song
.
i_l
==
0
)
msg_Dbg
(
p_this
,
"Song not listened long enough, not submitting"
);
p_sys
->
p_current_song
.
i_l
=
played_time
;
goto
end
;
}
/* Don't send song shorter than 30s */
if
(
p_sys
->
p_current_song
.
i_l
<
30
)
if
(
p_sys
->
p_current_song
.
i_l
<
30
)
{
if
(
played_time
<
30
)
{
{
msg_Dbg
(
p_this
,
"Song too short (< 30s), not submitting"
);
msg_Dbg
(
p_this
,
"Song too short (< 30s), not submitting"
);
goto
end
;
goto
end
;
}
}
else
/* This is a HACK to avoid length = 0 (seems to be rejected by audioscrobbler) */
/* Send if the user had listen more than 240s OR half the track length */
p_sys
->
p_current_song
.
i_l
=
played_time
;
if
(
(
played_time
<
240
)
&&
(
played_time
<
(
p_sys
->
p_current_song
.
i_l
/
2
)
)
)
{
msg_Dbg
(
p_this
,
"Song not listened long enough, not submitting"
);
goto
end
;
}
}
/* Check that all meta are present */
if
(
!
p_sys
->
p_current_song
.
psz_a
||
!*
p_sys
->
p_current_song
.
psz_a
||
if
(
!
p_sys
->
p_current_song
.
psz_a
||
!*
p_sys
->
p_current_song
.
psz_a
||
!
p_sys
->
p_current_song
.
psz_t
||
!*
p_sys
->
p_current_song
.
psz_t
)
!
p_sys
->
p_current_song
.
psz_t
||
!*
p_sys
->
p_current_song
.
psz_t
)
{
{
msg_Dbg
(
p_this
,
"Missing artist or title, not submitting"
);
msg_Dbg
(
p_this
,
"Missing artist or title, not submitting"
);
/*XXX*/
msg_Dbg
(
p_this
,
"%s %s"
,
p_sys
->
p_current_song
.
psz_a
,
p_sys
->
p_current_song
.
psz_t
);
goto
end
;
goto
end
;
}
}
...
@@ -952,6 +953,8 @@ static int ReadMetaData( intf_thread_t *p_this )
...
@@ -952,6 +953,8 @@ static int ReadMetaData( intf_thread_t *p_this )
a = encode_URI_component( psz_meta ); \
a = encode_URI_component( psz_meta ); \
if( !a ) \
if( !a ) \
{ \
{ \
vlc_mutex_unlock( &p_sys->lock ); \
vlc_object_release( p_input ); \
free( psz_meta ); \
free( psz_meta ); \
return VLC_ENOMEM; \
return VLC_ENOMEM; \
} \
} \
...
...
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