~titan-lien/ubuntu/saucy/totem/totem.dev

« back to all changes in this revision

Viewing changes to src/gst/totem-time-helpers.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-26 00:07:51 UTC
  • mfrom: (1.6.1) (24.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130526000751-kv8ap3x1di4qq8j2
Tags: 3.8.2-0ubuntu1
* Sync with Debian. Remaining changes: 
* debian/control.in:
  - Drop build-depends on libepc-ui-dev and libgrilo-0.2-dev (in universe)
  - Drop libxtst-dev build-depends so that the (redundant) fake key presses
    for inhibiting the screensaver are disabled (LP: #1007438)
  - Build-depend on libzeitgeist-dev
  - Suggest rather than recommend gstreamer components in universe
  - Add totem-plugins-extra
  - Add XB-Npp-Description and XB-Npp-Filename header to the 
    totem-mozilla package to improve ubufox/ubuntu plugin db integration 
  - Refer to Firefox in totem-mozilla description instead of Iceweasel
  - Don't have totem-mozilla recommend any particular browser
  - Drop obsolete python library dependencies since iplayer is no longer
    included
* debian/totem-common.install, debian/source_totem.py:
  - Install Ubuntu apport debugging hook
* debian/totem-plugins-extra.install:
  - Universe plugins split out of totem-plugins (currently only gromit)
* debian/totem-plugins.install:    
  - Skip the plugins split to -extra and add the zeitgeist plugin
* debian/rules:
  - Build with --fail-missing, to ensure we install everything. 
    + Ignore libtotem.{,l}a since we delibrately don't install these.
  - Re-enable hardening, make sure both PIE and BINDNOW are used
    by setting hardening=+all. (LP: #1039604)
* debian/patches/91_quicklist_entries.patch:
  - Add static quicklist
* debian/patches/92_gst-plugins-good.patch:
  - Build without unnecessary gstreamer1.0-bad dependency
* debian/patches/93_grilo_optional.patch:
  - Allow building without grilo while grilo MIR is still pending
* debian/patches/correct_desktop_mimetypes.patch:
  - Don't list the mimetypes after the unity lists
* debian/patches/revert_shell_menu.patch: 
  - revert the use of a shell menu until indicator-appmenu can handle
    the mixed shell/traditional menus itself
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2002-2012 Bastien Nocera <hadess@hadess.net>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 
17
 *
 
18
 * The Totem project hereby grant permission for non-gpl compatible GStreamer
 
19
 * plugins to be used and distributed together with GStreamer and Totem. This
 
20
 * permission is above and beyond the permissions granted by the GPL license
 
21
 * Totem is covered by.
 
22
 *
 
23
 * Monday 7th February 2005: Christian Schaller: Add exception clause.
 
24
 * See license_change file for details.
 
25
 *
 
26
 */
 
27
 
 
28
#include <glib/gi18n.h>
 
29
#include <libintl.h>
 
30
 
 
31
#include "totem-time-helpers.h"
 
32
 
 
33
 
 
34
/* FIXME: Remove
 
35
 * See https://bugzilla.gnome.org/show_bug.cgi?id=679850 */
 
36
char *
 
37
totem_time_to_string (gint64 msecs)
 
38
{
 
39
        int sec, min, hour, _time;
 
40
 
 
41
        _time = (int) (msecs / 1000);
 
42
        sec = _time % 60;
 
43
        _time = _time - sec;
 
44
        min = (_time % (60*60)) / 60;
 
45
        _time = _time - (min * 60);
 
46
        hour = _time / (60*60);
 
47
 
 
48
        if (hour > 0)
 
49
        {
 
50
                /* hour:minutes:seconds */
 
51
                /* Translators: This is a time format, like "9:05:02" for 9
 
52
                 * hours, 5 minutes, and 2 seconds. You may change ":" to
 
53
                 * the separator that your locale uses or use "%Id" instead
 
54
                 * of "%d" if your locale uses localized digits.
 
55
                 */
 
56
                return g_strdup_printf (C_("long time format", "%d:%02d:%02d"), hour, min, sec);
 
57
        }
 
58
 
 
59
        /* minutes:seconds */
 
60
        /* Translators: This is a time format, like "5:02" for 5
 
61
         * minutes and 2 seconds. You may change ":" to the
 
62
         * separator that your locale uses or use "%Id" instead of
 
63
         * "%d" if your locale uses localized digits.
 
64
         */
 
65
        return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);
 
66
}