Changeset 20b02ab8c9d50b794ba6515ba3bbcc0acc3a7294

Show
Ignore:
Timestamp:
15/01/08 14:45:41 (11 months ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1200404741 +0000
git-parent:

[0d0ad1638c3e659a682a49c94851710ffc9ff285]

git-author:
Rafaël Carré <funman@videolan.org> 1200404741 +0000
Message:

audioscrobbler: do not use mdate() when the real date is needed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/audioscrobbler.c

    r910dd49 r20b02ab  
    3131 *****************************************************************************/ 
    3232 
     33#if defined( WIN32 )  
     34#include <time.h>  
     35#endif  
     36 
    3337#include <vlc/vlc.h> 
    3438#include <vlc_interface.h> 
     
    5559    int         i_l;                /**< track length     */ 
    5660    char        *psz_m;             /**< musicbrainz id   */ 
    57     mtime_t     date;               /**< date since epoch */ 
     61    time_t      date;               /**< date since epoch */ 
    5862} audioscrobbler_song_t; 
    5963 
     
    259263 
    260264    /* main loop */ 
    261     while( !p_intf->b_die && !p_intf->p_libvlc->b_die
     265    while( !intf_ShouldDie( p_intf )
    262266    { 
    263267        /* waiting for data to submit, if waiting interval is elapsed */ 
     
    345349                    "&n%%5B%d%%5D=%s&m%%5B%d%%5D=%s", 
    346350                    i_song, p_song->psz_a,           i_song, p_song->psz_t, 
    347                     i_song, (uintmax_t)(p_song->date / 1000000), i_song, i_song, 
     351                    i_song, (uintmax_t)p_song->date, i_song, i_song, 
    348352                    i_song, p_song->i_l,             i_song, p_song->psz_b, 
    349353                    i_song, p_song->psz_n,           i_song, p_song->psz_m 
     
    533537 
    534538    p_sys->time_total_pauses = 0; 
    535     p_sys->p_current_song.date = mdate(); 
     539    time( &p_sys->p_current_song.date ); 
    536540 
    537541    var_AddCallback( p_input, "state", PlayingChange, p_intf ); 
     
    693697{ 
    694698    char                *psz_username, *psz_password; 
    695     mtime_t             timestamp; 
     699    time_t              timestamp; 
    696700    char                psz_timestamp[33]; 
    697701 
     
    728732    } 
    729733 
    730     timestamp = mdate(); 
     734    time( &timestamp ); 
    731735 
    732736    /* generates a md5 hash of the password */ 
     
    744748    } 
    745749 
    746     snprintf( psz_timestamp, 33, "%llu", (uintmax_t)(timestamp / 1000000) ); 
     750    snprintf( psz_timestamp, 33, "%llu", (uintmax_t)timestamp ); 
    747751 
    748752    /* generates a md5 hash of :