|
From: <lin...@us...> - 2004-07-09 08:05:33
|
Update of /cvsroot/dvbtools/dvbsubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7878 Modified Files: pes.c dvbtextsubs.c Log Message: Add WIN32 conditional code to aid compilation with lcc-win - thanks to Alexandre Ferrieux Index: pes.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/pes.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pes.c 5 Apr 2004 21:16:45 -0000 1.5 --- pes.c 9 Jul 2004 08:05:14 -0000 1.6 *************** *** 8,11 **** --- 8,15 ---- #include "pes.h" + #ifdef WIN32 + typedef int ssize_t; + #endif + extern uint64_t audio_pts,first_audio_pts; extern int audio_pts_wrap; Index: dvbtextsubs.c =================================================================== RCS file: /cvsroot/dvbtools/dvbsubs/dvbtextsubs.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dvbtextsubs.c 9 Jul 2004 07:57:47 -0000 1.12 --- dvbtextsubs.c 9 Jul 2004 08:05:24 -0000 1.13 *************** *** 53,56 **** --- 53,57 ---- #include "pes.h" + #define PESBUFSIZE 1265536 #define VERSION "0.3" #define USAGE "\n\ *************** *** 556,560 **** int main(int argc, char** argv) { ! unsigned char pesbuf[1265536]; int pes_format=0; int PES_packet_length; --- 557,561 ---- int main(int argc, char** argv) { ! unsigned char* pesbuf; int pes_format=0; int PES_packet_length; *************** *** 566,569 **** --- 567,577 ---- is_first=0; + pesbuf=malloc(PESBUFSIZE); + if (!pesbuf) { + fprintf(stderr,"ERROR: Can not allocate memory for PES buffer, aborting.\n"); + fflush(stderr); + exit(1); + } + memset(prevpage.pagebuf,' ', 25*40); for (i=1;i<25;i++) { prevpage.line_transmitted[i]=0; } *************** *** 618,621 **** --- 626,634 ---- thepage.valid=0; + #ifdef WIN32 + // stupid idiot non-binary mode is default there + _setmode(_fileno(stdin),_O_BINARY); + #endif + if (subformat==SUBFORMAT_XML) { printf("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"); |