~ubuntu-branches/ubuntu/lucid/gecko-mediaplayer/lucid-proposed

« back to all changes in this revision

Viewing changes to src/libgmlib/gm_strfuncs.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2009-09-24 13:55:35 UTC
  • mfrom: (1.1.14 upstream) (0.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20090924135535-ftwq9l1ntkt9tdfp
Tags: 0.9.8-1ubuntu1
* Merge from debian unstable (LP: #434106), remaining changes:
  - change Build-Depends iceape-dev to libxul-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
            }
60
60
        }
61
61
    }
62
 
}
 
 
b'\\ No newline at end of file'
 
62
}
 
63
 
 
64
gint gm_str_hms_in_seconds(gchar *timestr)
 
65
{
 
66
        gchar **split;
 
67
        gint ret = 0;
 
68
        
 
69
        split = g_strsplit(timestr,":",0);
 
70
 
 
71
        switch (g_strv_length(split)) {
 
72
                case 1: 
 
73
                        ret = g_ascii_strtod(split[0],NULL);
 
74
                        break;
 
75
                case 2:
 
76
                        ret = g_ascii_strtod(split[0],NULL) * 60 + g_ascii_strtod(split[1],NULL);
 
77
                        break;
 
78
                case 3:
 
79
                        ret = g_ascii_strtod(split[0],NULL) * 3600 + g_ascii_strtod(split[1],NULL) * 60 + g_ascii_strtod(split[2],NULL);
 
80
                        break;
 
81
        }
 
82
        
 
83
        g_strfreev(split);
 
84
        
 
85
        return ret;
 
86
}
 
87