~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavutil/log.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-12-21 15:32:13 UTC
  • mto: (1.2.18)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121221153213-fudzrugjzivtv0wp
Tags: upstream-9~beta3
ImportĀ upstreamĀ versionĀ 9~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#if HAVE_UNISTD_H
30
30
#include <unistd.h>
31
31
#endif
 
32
#if HAVE_IO_H
 
33
#include <io.h>
 
34
#endif
32
35
#include <stdlib.h>
33
36
#include "avstring.h"
34
37
#include "avutil.h"
38
41
static int av_log_level = AV_LOG_INFO;
39
42
static int flags;
40
43
 
41
 
#if defined(_WIN32) && !defined(__MINGW32CE__)
 
44
#if HAVE_SETCONSOLETEXTATTRIBUTE
42
45
#include <windows.h>
43
 
#include <io.h>
44
46
static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
45
47
static int16_t background, attr_orig;
46
48
static HANDLE con;
53
55
#endif
54
56
static int use_color = -1;
55
57
 
56
 
#undef fprintf
57
58
static void colored_fputs(int level, const char *str)
58
59
{
59
60
    if (use_color < 0) {
60
 
#if defined(_WIN32) && !defined(__MINGW32CE__)
 
61
#if HAVE_SETCONSOLETEXTATTRIBUTE
61
62
        CONSOLE_SCREEN_BUFFER_INFO con_info;
62
63
        con = GetStdHandle(STD_ERROR_HANDLE);
63
64
        use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
102
103
    if (level > av_log_level)
103
104
        return;
104
105
    line[0] = 0;
105
 
#undef fprintf
106
106
    if (print_prefix && avc) {
107
107
        if (avc->parent_log_context_offset) {
108
108
            AVClass** parent = *(AVClass ***) (((uint8_t *) ptr) +