1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
|
/*
ogminfo -- utility for extracting raw streams from an OGG media file
Written by Moritz Bunkus <moritz@bunkus.org>
Integrated into transcode by Tilmann Bitterberg <transcode@tibit.org>
Distributed under the GPL
see the file COPYING for details
or visit http://www.gnu.org/copyleft/gpl.html
*/
#include "transcode.h"
#include "libtc/libtc.h"
#include "tcinfo.h"
#include <sys/types.h>
#include "ioaux.h"
#include "tc.h"
#define NOAUDIO 0
#define NOVIDEO 1
#define NOTEXT 2
unsigned char *xaudio = NULL;
unsigned char *xvideo = NULL;
unsigned char *xtext = NULL;
int no[3];
int xraw = 0;
static int verbose_flag = TC_QUIET;
#if (HAVE_OGG && HAVE_VORBIS)
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include "ogmstreams.h"
#define BLOCK_SIZE 4096
#define ACVORBIS 0xffff
#define ACPCM 0x0001
#define ACMP3 0x0055
#define ACAC3 0x2000
typedef struct stream_t {
int serial;
int fd;
double sample_rate;
int eos, comment;
int sno;
char stype;
ogg_stream_state instate;
struct stream_t *next;
int acodec;
ogg_int64_t bwritten;
ogg_stream_state outstate;
int packetno;
ogg_int64_t max_granulepos;
int subnr;
} stream_t;
stream_t *first;
int nastreams = 0, nvstreams = 0, ntstreams = 0, numstreams = 0;
char basename[] = "stdout";
static void add_stream(stream_t *ndmx) {
stream_t *cur = first;
if (first == NULL) {
first = ndmx;
first->next = NULL;
} else {
cur = first;
while (cur->next != NULL)
cur = cur->next;
cur->next = ndmx;
ndmx->next = NULL;
}
}
static stream_t *find_stream(int fserial) {
stream_t *cur = first;
while (cur != NULL) {
if (cur->serial == fserial)
break;
cur = cur->next;
}
return cur;
}
double highest_ts = 0;
static int extraction_requested(unsigned char *s, int stream, int type) {
int i;
if (no[type])
return 0;
if (strlen((char *)s) == 0)
return 1;
for (i = 0; i < strlen((char *)s); i++)
if (s[i] == stream)
return 1;
return 0;
}
static void flush_pages(stream_t *stream, ogg_packet *op) {
ogg_page page;
while (ogg_stream_flush(&stream->outstate, &page)) {
int ih, ib;
ih = tc_pwrite(stream->fd, page.header, page.header_len);
if (ih != page.header_len) {
tc_log_error(__FILE__, "error while writing page header");
import_exit(1); /* XXX ugly */
}
ib = tc_pwrite(stream->fd, page.body, page.body_len);
if (ib != page.body_len) {
tc_log_error(__FILE__, "error while writing page bofy");
import_exit(1); /* XXX ugly */
}
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/a%d: %d + %d written", stream->sno, ih, ib);
}
}
static void write_pages(stream_t *stream, ogg_packet *op) {
ogg_page page;
while (ogg_stream_pageout(&stream->outstate, &page)) {
int ih, ib;
ih = tc_pwrite(stream->fd, page.header, page.header_len);
if (ih != page.header_len) {
tc_log_error(__FILE__, "error while writing page header");
import_exit(1); /* XXX ugly */
}
ib = tc_pwrite(stream->fd, page.body, page.body_len);
if (ib != page.body_len) {
tc_log_error(__FILE__, "error while writing page bofy");
import_exit(1); /* XXX ugly */
}
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/a%d: %d + %d written", stream->sno, ih, ib);
}
}
static void handle_packet(stream_t *stream, ogg_packet *pack, ogg_page *page) {
int i, w, hdrlen, end;
long long lenbytes;
char *sub;
char out[100];
ogg_int64_t pgp, sst;
//tc_log_msg(__FILE__, "Going handle 1");
if (pack->e_o_s) {
stream->eos = 1;
pack->e_o_s = 1;
}
if (((double)pack->granulepos * 1000.0 / (double)stream->sample_rate) >
highest_ts)
highest_ts = (double)pack->granulepos * 1000.0 /
(double)stream->sample_rate;
switch (stream->stype) {
case 'v':
if (!extraction_requested(xvideo, stream->sno, NOVIDEO))
return;
break;
case 'a':
if (!extraction_requested(xaudio, stream->sno, NOAUDIO))
return;
break;
case 't':
if (!extraction_requested(xtext, stream->sno, NOTEXT))
return;
break;
}
hdrlen = (*pack->packet & OGM_PACKET_LEN_BITS01) >> 6;
hdrlen |= (*pack->packet & OGM_PACKET_LEN_BITS2) << 1;
for (i = 0, lenbytes = 0; i < hdrlen; i++) {
lenbytes = lenbytes << 8;
lenbytes += *((unsigned char *)pack->packet + hdrlen - i);
}
switch (stream->stype) {
case 'v':
if (((*pack->packet & 3) == OGM_PACKET_TYPE_HEADER) ||
((*pack->packet & 3) == OGM_PACKET_TYPE_COMMENT))
return;
i = tc_pwrite(stream->fd, (char *)&pack->packet[hdrlen + 1],
pack->bytes - 1 - hdrlen);
if (i != pack->bytes - 1 - hdrlen) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/v%d: %d written", stream->sno, i);
break;
case 't':
if (((*pack->packet & 3) == OGM_PACKET_TYPE_HEADER) ||
((*pack->packet & 3) == OGM_PACKET_TYPE_COMMENT))
return;
if (xraw) {
i = tc_pwrite(stream->fd, (char *)&pack->packet[hdrlen + 1],
pack->bytes - 1 - hdrlen);
if (i != pack->bytes - 1 - hdrlen) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/t%d: %d written", stream->sno, i);
return;
}
sub = (char *)&pack->packet[hdrlen + 1];
if ((strlen(sub) > 1) || (*sub != ' ')) {
sst = (pack->granulepos / stream->sample_rate) * 1000;
pgp = sst + lenbytes;
tc_snprintf(out,sizeof(out), "%d\r\n%02d:%02d:%02d,%03d --> " \
"%02d:%02d:%02d,%03d\r\n", stream->subnr + 1,
(int)(sst / 3600000),
(int)(sst / 60000) % 60,
(int)(sst / 1000) % 60,
(int)(sst % 1000),
(int)(pgp / 3600000),
(int)(pgp / 60000) % 60,
(int)(pgp / 1000) % 60,
(int)(pgp % 1000));
i = tc_pwrite(stream->fd, out, strlen(out));
if (i != strlen(out)) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
end = strlen(sub) - 1;
while ((end >= 0) && ((sub[end] == '\n') || (sub[end] == '\r'))) {
sub[end] = 0;
end--;
}
w = tc_pwrite(stream->fd, sub, strlen(sub));
if (i == strlen(sub)) {
i += w;
} else {
tc_log_error(__FILE__, "error while writing data");
import_exit(1);
}
w = tc_pwrite(stream->fd, "\r\n\r\n", 4);
if (w == 4) {
i += w;
} else {
tc_log_error(__FILE__, "error while writing data");
import_exit(1);
}
stream->subnr++;
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/t%d: %d written", stream->sno, i);
}
break;
case 'a':
switch (stream->acodec) {
case ACVORBIS:
if (xraw) {
if (stream->packetno == 0) {
i = tc_pwrite(stream->fd, (char *)pack->packet, pack->bytes);
if (i != pack->bytes) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
} else {
i = tc_pwrite(stream->fd, (char *)&pack->packet[1],
pack->bytes - 1);
if (i != pack->bytes - 1) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
}
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/a%d: %d written", stream->sno, i);
return;
}
stream->max_granulepos = (pack->granulepos > stream->max_granulepos ?
pack->granulepos : stream->max_granulepos);
if ((stream->packetno == 0) || (stream->packetno == 2)) {
ogg_stream_packetin(&stream->outstate, pack);
flush_pages(stream, pack);
} else {
ogg_stream_packetin(&stream->outstate, pack);
write_pages(stream, pack);
}
stream->packetno++;
break;
default:
if (((*pack->packet & 3) == OGM_PACKET_TYPE_HEADER) ||
((*pack->packet & 3) == OGM_PACKET_TYPE_COMMENT))
return;
i = tc_pwrite(stream->fd, pack->packet + 1 + hdrlen,
pack->bytes - 1 - hdrlen);
if (i != pack->bytes - 1 - hdrlen) {
tc_log_error(__FILE__, "error while writing data");
import_exit(1); /* XXX ugly */
}
stream->bwritten += i;
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "x/a%d: %d written", stream->sno, i);
break;
}
break;
}
}
static void process_ogm(int fdin, int fdout)
{
ogg_sync_state sync;
ogg_page page;
ogg_packet pack;
vorbis_info vi;
vorbis_comment vc;
char *buf, *new_name;
int nread, np, sno;
int endofstream = 0;
stream_t *stream = NULL;
ogg_sync_init(&sync);
while (1) {
np = ogg_sync_pageseek(&sync, &page);
if (np < 0) {
tc_log_error(__FILE__, "ogg_sync_pageseek failed");
return;
}
if (np == 0) {
buf = ogg_sync_buffer(&sync, BLOCK_SIZE);
if (!buf) {
tc_log_error(__FILE__, "ogg_sync_buffer failed");
return;
}
if ((nread = read(fdin, buf, BLOCK_SIZE)) <= 0) {
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "end of stream 1");
return;
}
ogg_sync_wrote(&sync, nread);
continue;
}
if (!ogg_page_bos(&page)) {
break;
} else {
ogg_stream_state sstate;
sno = ogg_page_serialno(&page);
if (ogg_stream_init(&sstate, sno)) {
tc_log_error(__FILE__, "ogg_stream_init failed");
return;
}
ogg_stream_pagein(&sstate, &page);
ogg_stream_packetout(&sstate, &pack);
if ((pack.bytes >= 7) && ! strncmp(&pack.packet[1], "vorbis", 6)) {
stream = tc_malloc(sizeof(stream_t));
if (stream == NULL) {
tc_log_error(__FILE__, "malloc failed.");
exit(1);
}
memset(stream, 0, sizeof(stream_t));
if (verbose_flag & TC_INFO) {
vorbis_info_init(&vi);
vorbis_comment_init(&vc);
if (vorbis_synthesis_headerin(&vi, &vc, &pack) >= 0) {
tc_log_info(__FILE__, "(a%d/%d) Vorbis audio (channels %d "
"rate %ld)", nastreams + 1, numstreams + 1,
vi.channels, vi.rate);
stream->sample_rate = vi.rate;
} else
tc_log_warn(__FILE__, "(a%d/%d) Vorbis audio stream indicated "
"but no Vorbis stream header found.",
nastreams + 1, numstreams + 1);
}
stream->serial = sno;
stream->acodec = ACVORBIS;
stream->sample_rate = -1;
stream->sno = nastreams + 1;
stream->stype = 'a';
ac_memcpy(&stream->instate, &sstate, sizeof(sstate));
if (extraction_requested(xaudio, nastreams + 1, NOAUDIO)) {
stream->fd = fdout;
if (stream->fd == -1) {
tc_log_error(__FILE__, "Failed to create \"%s\" (%d, %s).",
"new_name", errno, strerror(errno));
exit(1);
}
if (!xraw)
ogg_stream_init(&stream->outstate, rand());
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "Extracting a%d to \"%s\".",
nastreams + 1, "new_name");
do
handle_packet(stream, &pack, &page);
while (ogg_stream_packetout(&stream->instate, &pack) == 1);
}
add_stream(stream);
nastreams++;
numstreams++;
} else if ((pack.bytes >= 142) &&
!strncmp(&pack.packet[1],"Direct Show Samples embedded in Ogg",
35) ) {
if ((*(int32_t*)(pack.packet+96) == 0x05589f80) &&
(pack.bytes >= 184)) {
tc_log_warn(__FILE__, "(v%d/%d) Found old video header. Not "
"supported.", nvstreams + 1, numstreams + 1);
} else if (*(int32_t*)pack.packet+96 == 0x05589F81) {
tc_log_warn(__FILE__, "(a%d/%d) Found old audio header. Not "
"supported.", nastreams + 1, numstreams + 1);
} else {
if (verbose_flag & TC_INFO)
tc_log_warn(__FILE__, "OGG stream %d has an old header with an "
"unknown type.", numstreams + 1);
}
} else if (((*pack.packet & OGM_PACKET_TYPE_BITS ) == OGM_PACKET_TYPE_HEADER) &&
(pack.bytes >= (int)(sizeof(ogm_stream_header) + 1 - sizeof(int)))) {
ogm_stream_header *sth = (ogm_stream_header *)(pack.packet + 1);
if (!strncmp(sth->streamtype, "video", 5)) {
unsigned long codec;
char ccodec[5];
strncpy(ccodec, sth->subtype, 4);
ccodec[4] = 0;
codec = (sth->subtype[0] << 24) +
(sth->subtype[1] << 16) + (sth->subtype[2] << 8) + sth->subtype[3];
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "(v%d/%d) fps: %.3f width height: %dx%d "
"codec: %p (%s)", nvstreams + 1, numstreams + 1,
(double)10000000 / (double)sth->time_unit,
sth->sh.video.width, sth->sh.video.height,
(void *)codec, ccodec);
stream = tc_malloc(sizeof(stream_t));
if (stream == NULL) {
tc_log_error(__FILE__, "malloc failed.");
exit(1);
}
stream->stype = 'v';
stream->serial = sno;
stream->sample_rate = (double)10000000 / (double)sth->time_unit;
stream->sno = nvstreams + 1;
ac_memcpy(&stream->instate, &sstate, sizeof(sstate));
if (extraction_requested(xvideo, nvstreams + 1, NOVIDEO)) {
stream->fd = fdout;
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "Extracting v%d to \"%s\".",
nvstreams + 1, "new_name");
do {
handle_packet(stream, &pack, &page);
} while (ogg_stream_packetout(&stream->instate, &pack) == 1);
}
add_stream(stream);
nvstreams++;
numstreams++;
} else if (!strncmp(sth->streamtype, "audio", 5)) {
int codec;
char buf[5];
ac_memcpy(buf, sth->subtype, 4);
buf[4] = 0;
codec = strtoul(buf, NULL, 16);
if (verbose_flag & TC_INFO) {
tc_log_info(__FILE__, "(a%d/%d) codec: %d (0x%04x) (%s), bits per "
"sample: %d channels: %hd samples per second: %lld "
" avgbytespersec: %hd blockalign: %d",
nastreams + 1, numstreams + 1, codec, codec,
codec == ACPCM ? "PCM" : codec == 55 ? "MP3" :
codec == ACMP3 ? "MP3" :
codec == ACAC3 ? "AC3" : "unknown",
sth->bits_per_sample, sth->sh.audio.channels,
(long long)sth->samples_per_unit,
sth->sh.audio.avgbytespersec, sth->sh.audio.blockalign);
}
stream = tc_malloc(sizeof(stream_t));
if (stream == NULL) {
tc_log_error(__FILE__, "malloc failed.");
exit(1);
}
stream->sno = nastreams + 1;
stream->stype = 'a';
stream->sample_rate = sth->samples_per_unit *
sth->sh.audio.channels;
stream->serial = sno;
stream->acodec = codec;
ac_memcpy(&stream->instate, &sstate, sizeof(sstate));
if (extraction_requested(xaudio, nastreams + 1, NOAUDIO)) {
/*
codec == ACPCM ? "wav" :
codec == ACMP3 ? "mp3" :
codec == ACAC3 ? "ac3" : "audio");
*/
stream->fd = fdout;
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "Extracting a%d to \"%s\".",
nastreams + 1, "new_name");
do {
handle_packet(stream, &pack, &page);
} while (ogg_stream_packetout(&stream->instate, &pack) == 1);
}
add_stream(stream);
nastreams++;
numstreams++;
} else if (!strncmp(sth->streamtype, "text", 4)) {
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "(t%d/%d) text/subtitle stream",
ntstreams + 1, numstreams + 1);
stream = tc_malloc(sizeof(stream_t));
if (stream == NULL) {
tc_log_error(__FILE__, "malloc failed.");
exit(1);
}
stream->sno = ntstreams + 1;
stream->stype = 't';
stream->sample_rate = (double)10000000 / (double)sth->time_unit;
stream->serial = sno;
ac_memcpy(&stream->instate, &sstate, sizeof(sstate));
if (extraction_requested(xtext, ntstreams + 1, NOTEXT)) {
new_name = tc_malloc(strlen(basename) + 20);
if (!new_name) {
tc_log_error(__FILE__, "Failed to allocate %d bytes.",
(int)strlen(basename) + 20);
exit(1);
}
if (!xraw)
tc_snprintf(new_name, strlen(basename) + 20, "%s-t%d.srt", basename, ntstreams + 1);
else
tc_snprintf(new_name, strlen(basename) + 20, "%s-t%d.raw", basename, ntstreams + 1);
//stream->fd = open(new_name, O_WRONLY | O_CREAT | O_TRUNC,
// S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
stream->fd = fdout;
if (stream->fd == -1) {
tc_log_error(__FILE__, "Failed to create \"%s\" (%d, %s).",
new_name, errno, strerror(errno));
exit(1);
}
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "Extracting t%d to \"%s\".",
ntstreams + 1, new_name);
do
handle_packet(stream, &pack, &page);
while (ogg_stream_packetout(&stream->instate, &pack) == 1);
}
add_stream(stream);
ntstreams++;
numstreams++;
} else {
tc_log_warn(__FILE__, "(%d) found new header of unknown/"
"unsupported type\n", numstreams + 1);
}
} else {
tc_log_warn(__FILE__, "OGG stream %d is of an unknown type "
"(bad header?)\n", numstreams + 1);
}
}
}
endofstream = 0;
while (!endofstream) {
sno = ogg_page_serialno(&page);
stream = find_stream(sno);
if (stream == NULL) {
if (verbose_flag & TC_DEBUG)
tc_log_warn(__FILE__, "Encountered packet for an unknown serial "
"%d !?\n", sno);
} else {
if (verbose_flag & TC_DEBUG)
tc_log_msg(__FILE__, "%c%d: NEW PAGE", stream->stype, stream->sno);
ogg_stream_pagein(&stream->instate, &page);
while (ogg_stream_packetout(&stream->instate, &pack) == 1)
handle_packet(stream, &pack, &page);
}
while (ogg_sync_pageseek(&sync, &page) <= 0) {
buf = ogg_sync_buffer(&sync, BLOCK_SIZE);
nread = read(fdin, buf, BLOCK_SIZE);
if (nread <= 0) {
stream = first;
while (stream != NULL) {
switch (stream->stype) {
case 'v':
close(stream->fd);
break;
case 't':
if (stream->fd > 0)
close(stream->fd);
break;
case 'a':
if ((stream->fd > 0) && !xraw) {
switch (stream->acodec) {
case ACVORBIS:
if (!stream->eos) {
pack.b_o_s = 0;
pack.e_o_s = 1;
pack.packet = NULL;
pack.bytes = 0;
pack.granulepos = stream->max_granulepos;
pack.packetno = stream->packetno;
ogg_stream_packetin(&stream->outstate, &pack);
}
flush_pages(stream, &pack);
ogg_stream_clear(&stream->outstate);
break;
}
close(stream->fd);
} else if (stream->fd > 0)
close(stream->fd);
break;
}
stream = stream->next;
}
if (verbose_flag & TC_INFO)
tc_log_info(__FILE__, "end of stream");
endofstream = 1;
break;
} else
ogg_sync_wrote(&sync, nread);
}
}
}
#endif /* have OGG */
void extract_ogm (info_t *ipipe)
{
// track
no[NOTEXT] = 1;
no[NOAUDIO] = 0;
no[NOVIDEO] = 0;
xraw = 1;
xvideo = tc_zalloc (16); xaudio = tc_zalloc (16); xtext = tc_zalloc (16);
verbose_flag = ipipe->verbose;
if (ipipe->select == TC_VIDEO) {
no[NOAUDIO] = 1;
xvideo[0] = (unsigned char)(ipipe->track+1);
}
if (ipipe->select == TC_AUDIO) {
no[NOVIDEO] = 1;
xaudio[0] = (unsigned char)(ipipe->track+1);
// we need !xraw because no tool seems to be able to handle
// raw vorbis streams -- tibit
if (ipipe->codec == TC_CODEC_VORBIS) {
xraw = 0;
}
}
#if (HAVE_OGG && HAVE_VORBIS)
process_ogm(ipipe->fd_in, ipipe->fd_out);
#else
tc_log_error(__FILE__, "No support for Ogg/Vorbis compiled in");
import_exit(1);
#endif
}
/* vim: sw=2
*/
|