1 diff -urN avifile-0.6.0.20011207/lib/common/util.cpp avifile-0.6.0.20011207-/lib/common/util.cpp
2 --- avifile-0.6.0.20011207/lib/common/util.cpp Wed Nov 21 23:33:02 2001
3 +++ avifile-0.6.0.20011207-/lib/common/util.cpp Wed Dec 19 01:58:31 2001
8 - printf("Available CPU flags: %s\n", flags);
9 + fprintf(stderr, "Available CPU flags: %s\n", flags);
10 have_tsc = (strstr(flags, "tsc") != 0);
11 have_mmx = (strstr(flags, "mmx") != 0);
12 have_sse = (strstr(flags, "sse") != 0);
17 - printf("%f MHz %s processor detected\n", freq/1000., model);
18 + fprintf(stderr, "%f MHz %s processor detected\n", freq/1000., model);
22 diff -urN avifile-0.6.0.20011207/samples/misc/Makefile.am avifile-0.6.0.20011207-/samples/misc/Makefile.am
23 --- avifile-0.6.0.20011207/samples/misc/Makefile.am Mon Dec 3 11:38:01 2001
24 +++ avifile-0.6.0.20011207-/samples/misc/Makefile.am Wed Dec 19 01:58:31 2001
26 avitype_SOURCES=avitype.cpp
28 extractor_SOURCES=extractor.cpp
29 +wma2wav_SOURCES=wma2wav.cpp
31 #plustest_SOURCES=plustest.cpp
32 #imtest_SOURCES=imtest.cpp
34 avitype_LDADD = $(LIBRARY)
36 extractor_LDADD = $(LIBRARY)
37 +wma2wav_LDADD = $(LIBRARY)
40 avimake_SOURCES = avimake.cpp
45 -bin_PROGRAMS = avibench avicat avitype $(PROG_AVIMAKE)
46 +bin_PROGRAMS = avibench avicat avitype $(PROG_AVIMAKE) wma2wav
47 check_PROGRAMS = asfdump asftest avitest extractor test
49 EXTRA_DIST = imtest.cpp plustest.cpp qualtest.cpp test.cpp
50 diff -urN avifile-0.6.0.20011207/samples/misc/wma2wav.cpp avifile-0.6.0.20011207-/samples/misc/wma2wav.cpp
51 --- avifile-0.6.0.20011207/samples/misc/wma2wav.cpp Thu Jan 1 01:00:00 1970
52 +++ avifile-0.6.0.20011207-/samples/misc/wma2wav.cpp Wed Dec 19 01:58:51 2001
55 + * Convert .wma files to .wav (so they can be treated with lame to produce
56 + * more reasonable output :^)
57 + * Copyright (c) 2001 Michal Moskal (malekith@pld.org.pl)
59 + * I was motivated to write this simple cuple of lines by Piotr Modrzyk,
60 + * and I wish to thank him here ;)
62 + * This program could be probably also used to extract soundtrack from
63 + * movies, but I don't mind and hence the name...
77 +#define __MODULE__ "wma2wav"
81 +int main(int argc, const char **argv)
83 + IAviReadFile *ac = 0;
84 + IAviReadStream *as = 0;
87 + const char *infile, *outfile;
89 + if (argc != 2 && argc != 3) {
90 + fprintf(stderr, "\n\nUSAGE: %s inputfile [outputfile]\n"
91 + "If outputfile is not present or is \"-\" "
92 + "stdout is used.\n\n", argv[0]);
96 + if (GetAvifileVersion() != AVIFILE_VERSION) {
98 + "This binary was compiled for Avifile ver. "
99 + "%f, but the but the library is ver. %f. Aborting.\n",
100 + AVIFILE_VERSION, GetAvifileVersion());
107 + if (outfile && strcmp(outfile, "-") == 0)
110 + if (outfile == NULL) {
113 + // copy messages to stderr
116 + out_fd = open(outfile, O_WRONLY|O_TRUNC|O_CREAT, 0666);
124 + ac = CreateIAviReadFile(infile);
126 + fprintf(stderr, "%s: can't read it\n", infile);
130 + as = ac->GetStream(0, AviStream::Audio);
132 + fprintf(stderr, "%s: doesn't contains audio stream\n",
137 + const int buffer_size = 2 * 1024 * 1024;
138 + zz = new uint8_t[buffer_size];
139 + size_t samp_read, bytes_read, sz;
142 + memset(&hdr, 0, sizeof(hdr));
143 + as->GetAudioFormatInfo(&hdr, NULL);
145 + write(out_fd, "RIFF\x0f\xff\xff\xffWAVEfmt \x10\0\0\0", 20);
147 + hdr.wFormatTag = 1;
148 + write(out_fd, &hdr, 16);
149 + write(out_fd, "data\x0f\xff\xff\xff", 8);
151 + as->StopStreaming();
152 + as->StartStreaming();
153 + while (!as->Eof()) {
154 + sz = as->GetFrameSize();
155 + if (sz > (size_t)buffer_size)
157 + as->ReadFrames(zz, sz, sz, samp_read, bytes_read);
158 + if (write(out_fd, zz, bytes_read) != (int)bytes_read) {
165 + } catch(FatalError & error) {
166 + fprintf(stderr, "Fatal error:\n");