~ubuntu-branches/ubuntu/saucy/submux-dvd/saucy

« back to all changes in this revision

Viewing changes to submux-dvd.c

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2013-05-05 14:59:47 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130505145947-m5gm70105evz7rbt
Tags: 0.5.2-0ubuntu1
* New upstream release.
* debian/source/format: Indicate 3.0 (quilt) format.
* debian/control:
  - Bump Standards-Version to 3.9.4.
  - Bump debhelper Build-Depends to >= 9.
  - Add Homepage field and remove homepage from Description.
  - Add ${misc:Depends} to Depends.
* debian/compat: Bump to 9.
* debian/watch: Update.
* debian/rules:
  - Add build-arch and build-indep targets.
  - Replace dh_clean -k with dh_prep.
  - Remove hyphen from $(MAKE) clean to fix lintian warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * DVD code copyright (C) 2002, 2003 Jan Panteltje <panteltje@yahoo.com>,
 
2
 * DVD code copyright (C) 2002, 2003, 20004, always Jan Panteltje <panteltje@yahoo.com>,
3
3
 * original CVD and SVCD code by unknown author.
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
24
24
 
25
25
#define _FILE_OFFSET_BITS   64
26
26
 
27
 
#define VERSION "0.5.1"
 
27
#define VERSION "0.5.2"
28
28
 
29
29
#define SUB_BUFFER_MAX          53220 
30
30
 
161
161
unsigned char bb, bc;
162
162
unsigned char *sub, *cbuf;
163
163
unsigned char *img, *fimg;
164
 
unsigned char nbuf[256];
 
164
//unsigned char nbuf[256];
 
165
char nbuf[256];
 
166
 
165
167
FILE *fds;
166
168
 
167
 
unsigned int subo, x0, y0, xd, yd, x0_, y0_, xd_, yd_;
 
169
static unsigned int subo, x0, y0, xd, yd, x0_, y0_, xd_, yd_; // -Wall, y0 is a build in function, static reduces its scope to this source file
168
170
unsigned int iline, progr, skip;
169
171
int sd, sd_;
170
172
int tofs, spts, nspts, lvpts;
607
609
 
608
610
void rns()
609
611
{
610
 
unsigned char lbuf[256 + 80];
 
612
//unsigned char lbuf[256 + 80];
 
613
char lbuf[256 + 80];
611
614
int a,b, i;
612
615
 
613
616
if(debug_flag)
635
638
 
636
639
/* get bitmap filename */ 
637
640
a = 0;
638
 
while(lbuf[a]  &&  (lbuf[a] != 32)  &&  (lbuf[a] != 9)) nbuf[a++] = lbuf[a];
 
641
while(lbuf[a]  &&  (lbuf[a] != 32)  &&  (lbuf[a] != 9))
 
642
        {
 
643
        nbuf[a] = lbuf[a];
 
644
        a++;
 
645
        }
 
646
 
639
647
/* string termination */
640
648
nbuf[a] = 0;
641
649
 
642
650
/* get start time */
643
651
while((lbuf[a])  &&  !((lbuf[a] > 47)  &&  (lbuf[a] < 58))) a++;
644
 
 nspts = atoi(lbuf + a) * 60 * 60 * 90000; a += 3;
 
652
nspts = atoi(lbuf + a) * 60 * 60 * 90000; a += 3;
645
653
nspts += atoi(lbuf + a) * 60 * 90000; a += 3;
646
654
nspts += atoi(lbuf + a) * 90000; a += 3;
647
655
nspts += atoi(lbuf + a) * 900; a += 2;
954
962
                } 
955
963
        a = 0;
956
964
        for(y = 0; (y < yd) &&  (y < yd); y++) 
957
 
                for(x = 0; (x < xd)  &&  (x < xd); x++) fimg[a++] = img[a];
958
 
    
 
965
                {
 
966
                for(x = 0; (x < xd)  &&  (x < xd); x++)
 
967
                        {
 
968
                        fimg[a] = img[a];
 
969
                        a++;
 
970
                        }
 
971
                }    
 
972
 
959
973
//#define P_TEST2
960
974
#ifdef P_TEST2 
961
975
 for(a = 0; a < 4; a++)
1112
1126
int fdi, fdo;
1113
1127
unsigned int q, c, a, i, j, k, gts, pts, muxrate, sector_size, frame, lps;
1114
1128
unsigned short int b, vss, subno;
1115
 
unsigned char cc, seq, psbuf[psbufs], substr, *nptr[3], ncnt;
 
1129
unsigned char cc, seq, psbuf[psbufs], substr;
 
1130
char *nptr[3];
 
1131
int ncnt;
1116
1132
int sub_size;
1117
1133
int bytes_send;
1118
1134
unsigned short int header_size;
1223
1239
fimg = malloc(maxx * maxy);
1224
1240
 
1225
1241
 
1226
 
fprintf(stderr, "submux-dvd-%s copyright 2003 Jan Panteltje\n", VERSION);
 
1242
fprintf(stderr, "submux-dvd-%s copyright 2002-always Jan Panteltje\n", VERSION);
1227
1243
 
1228
1244
if (argc<4)
1229
1245
        {
1644
1660
                        if(sub_size > max_sub_size)
1645
1661
                                {
1646
1662
                                max_sub_size = sub_size;
1647
 
                                fprintf(stderr, "max_sub_size=%d\n", max_sub_size);
 
1663
                                if(debug > 0)
 
1664
                                        {
 
1665
                                        fprintf(stderr, "max_sub_size=%d\n", max_sub_size);
 
1666
                                        }
1648
1667
                                }
1649
1668
 
1650
1669
                        seq = 0;
2851
2870
        {
2852
2871
        for(x = 0; x < xd; x++)
2853
2872
                {
2854
 
                img[a++] = lpal[ img[a] ].t;
 
2873
                img[a] = lpal[ img[a] ].t;
2855
2874
//              img[a++] = pal[ img[a] ].t;
 
2875
 
 
2876
                a++;
2856
2877
                }
2857
2878
        }
2858
2879