]> git.sesse.net Git - vlc/blobdiff - modules/misc/audioscrobbler.c
wait INTERVAL if needed on submitting, and don't try to submit data
[vlc] / modules / misc / audioscrobbler.c
index e08e79028027d5076537d0cdd31334644d845230..d28b6beec211314bcdecc3dde0a21d6ab3f30789 100644 (file)
@@ -30,8 +30,6 @@
  * Preamble
  *****************************************************************************/
 
-#define _GNU_SOURCE
-#include <string.h>
 
 #if defined( WIN32 )
 #include <time.h>
@@ -151,7 +149,7 @@ vlc_module_begin();
     set_description( N_("Audioscrobbler submission Plugin") );
     add_string( "lastfm-username", "", NULL,
                 USERNAME_TEXT, USERNAME_LONGTEXT, VLC_FALSE );
-    add_string( "lastfm-password", "", NULL,
+    add_password( "lastfm-password", "", NULL,
                 PASSWORD_TEXT, PASSWORD_LONGTEXT, VLC_FALSE );
     set_capability( "interface", 0 );
     set_callbacks( Open, Close );
@@ -367,6 +365,10 @@ static void Run( intf_thread_t *p_this )
                         vlc_mutex_unlock ( &p_sys->lock );
                         break;
                 }
+                /* handshake is done or failed, lets start from 
+                 * beginning to check it out and wait INTERVAL if needed
+                 */
+                continue;
             }
 
             msg_Dbg( p_this, "Going to submit some data..." );
@@ -1095,7 +1097,7 @@ static int ReadMetaData( intf_thread_t *p_this )
         else
             psz_trackid = calloc( 1, 1 );
 
-        i_length = input_GetItem(p_input)->i_duration / 1000000;
+        i_length = input_item_GetDuration( input_GetItem( p_input ) ) / 1000000;
 
         vlc_mutex_lock ( &p_sys->lock );