~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/ffmpeg/libavformat/os_support.c

  • Committer: Bazaar Package Importer
  • Author(s): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Various utilities for ffmpeg system
 
3
 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
18
 */
 
19
#include "config.h"
 
20
#include "avformat.h"
 
21
#if defined(CONFIG_WINCE)
 
22
/* Skip includes on WinCE. */
 
23
#elif defined(CONFIG_WIN32)
 
24
#include <sys/types.h>
 
25
#include <sys/timeb.h>
 
26
#elif defined(CONFIG_OS2)
 
27
#include <string.h>
 
28
#include <sys/time.h>
 
29
#else
 
30
#include <unistd.h>
 
31
#include <fcntl.h>
 
32
#include <sys/time.h>
 
33
#endif
 
34
#include <time.h>
 
35
 
 
36
/**
 
37
 * gets the current time in micro seconds.
 
38
 */
 
39
int64_t av_gettime(void)
 
40
{
 
41
#if defined(CONFIG_WINCE)
 
42
    return timeGetTime() * int64_t_C(1000);
 
43
#elif defined(CONFIG_WIN32)
 
44
    struct timeb tb;
 
45
    _ftime(&tb);
 
46
    return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
 
47
#else
 
48
    struct timeval tv;
 
49
    gettimeofday(&tv,NULL);
 
50
    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
 
51
#endif
 
52
}
 
53
 
 
54
#if !defined(CONFIG_WINCE)
 
55
#if !defined(HAVE_LOCALTIME_R)
 
56
struct tm *localtime_r(const time_t *t, struct tm *tp)
 
57
{
 
58
    struct tm *l;
 
59
 
 
60
    l = localtime(t);
 
61
    if (!l)
 
62
        return 0;
 
63
    *tp = *l;
 
64
    return tp;
 
65
}
 
66
#endif /* !defined(HAVE_LOCALTIME_R) */
 
67
#endif /* !defined(CONFIG_WINCE) */