~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/tools/cws2fws.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    if (argc < 3)
30
30
    {
31
31
        printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
32
 
        exit(1);
 
32
        return 1;
33
33
    }
34
34
 
35
35
    fd_in = open(argv[1], O_RDONLY);
36
36
    if (fd_in < 0)
37
37
    {
38
38
        perror("Error opening input file");
39
 
        exit(1);
 
39
        return 1;
40
40
    }
41
41
 
42
42
    fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644);
44
44
    {
45
45
        perror("Error opening output file");
46
46
        close(fd_in);
47
 
        exit(1);
 
47
        return 1;
48
48
    }
49
49
 
50
50
    if (read(fd_in, &buf_in, 8) != 8)
52
52
        printf("Header error\n");
53
53
        close(fd_in);
54
54
        close(fd_out);
55
 
        exit(1);
 
55
        return 1;
56
56
    }
57
57
 
58
58
    if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S')
59
59
    {
60
60
        printf("Not a compressed flash file\n");
61
 
        exit(1);
 
61
        return 1;
62
62
    }
63
63
 
64
64
    fstat(fd_in, &statbuf);
71
71
    buf_in[0] = 'F';
72
72
    if (write(fd_out, &buf_in, 8) < 8) {
73
73
        perror("Error writing output file");
74
 
        exit(1);
 
74
        return 1;
75
75
    }
76
76
 
77
77
    zstream.zalloc = NULL;
97
97
        {
98
98
            printf("Error while decompressing: %d\n", ret);
99
99
            inflateEnd(&zstream);
100
 
            exit(1);
 
100
            return 1;
101
101
        }
102
102
 
103
103
        dbgprintf("a_in: %d t_in: %lu a_out: %d t_out: %lu -- %lu out\n",
106
106
 
107
107
        if (write(fd_out, &buf_out, zstream.total_out - last_out) < zstream.total_out - last_out) {
108
108
            perror("Error writing output file");
109
 
            exit(1);
 
109
            return 1;
110
110
        }
111
111
 
112
112
        i += len;
128
128
        lseek(fd_out, 4, SEEK_SET);
129
129
        if (write(fd_out, &buf_in, 4) < 4) {
130
130
            perror("Error writing output file");
131
 
            exit(1);
 
131
            return 1;
132
132
        }
133
133
    }
134
134