/* * Copyright (C) 2002, 2003 Jan Panteltje * With many changes by Scott Smith (trckjunky@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ // prog for encoding dvd subtitles and multiplexing them into an mpeg // available under GPL v2 #include "config.h" #include "compat.h" #include #include #include #include #include "rgb.h" #include "subgen.h" #include "textsub.h" // (90000*300)/(1260000/2048) // (9*300)/(126/2048) // (9*300*2048)/126 #define DVDRATE 43886 #define CVD_SUB_CHANNEL 0x0 #define SVCD_SUB_CHANNEL 0x70 #define DVD_SUB_CHANNEL 0x20 #define DVD_SUB 0 #define CVD_SUB 1 #define SVCD_SUB 2 #define psbufs 10 #define until_next_sub 1 //if 0 subs without length are made when subs are overlapping #define tbs 90 static unsigned char *cbuf; static unsigned int spuindex, progr; static int tofs; static int svcd; static uint64_t lps; stinfo **spus=0; int numspus=0; int have_textsub=0; int have_transparent=1; int transparent_color=0x808080; int skip; static char header[32]; unsigned char *sub; int debug; int max_sub_size; // these 4 lines of variables are used by mux() and main() to communicate static int subno,secsize,mode,fdo,header_size,muxrate; static unsigned char substr, *sector; static stinfo *newsti; static uint64_t gts, nextgts; /* ...