diff -urN dvdauthor-0.6.11.orig/src/da-internal.h dvdauthor-0.6.11/src/da-internal.h --- dvdauthor-0.6.11.orig/src/da-internal.h 2005-01-31 20:26:19.000000000 -0600 +++ dvdauthor-0.6.11/src/da-internal.h 2005-04-25 19:46:01.721218072 -0500 @@ -167,6 +167,7 @@ extern char *entries[]; extern int jumppad; extern char *pstypes[]; +extern int printWarnings; void write8(unsigned char *p,unsigned char d0,unsigned char d1, unsigned char d2,unsigned char d3, diff -urN dvdauthor-0.6.11.orig/src/dvdauthor.c dvdauthor-0.6.11/src/dvdauthor.c --- dvdauthor-0.6.11.orig/src/dvdauthor.c 2005-01-31 20:26:19.000000000 -0600 +++ dvdauthor-0.6.11/src/dvdauthor.c 2005-04-25 19:46:01.722217920 -0500 @@ -38,6 +38,12 @@ // jumping/calling to a wider number of destinations int jumppad=0; +// this flag allows the user to turn off any WARNings that we might not +// want to see. Audio discontinuity and re-muxing come to mind. +// by default the warnings are disabled, unless they specify -w to have +// them be displayed. +int printWarnings=0; + static char *vmpegdesc[4]={"","mpeg1","mpeg2",0}; static char *vresdesc[6]={"","720xfull","704xfull","352xfull","352xhalf",0}; static char *vformatdesc[4]={"","ntsc","pal",0}; @@ -1040,6 +1046,11 @@ jumppad=1; } +void dvdauthor_enable_warnings() +{ + printWarnings=1; +} + void dvdauthor_vmgm_gen(struct pgc *fpc,struct menugroup *menus,char *fbase) { DIR *d; diff -urN dvdauthor-0.6.11.orig/src/dvdauthor.h dvdauthor-0.6.11/src/dvdauthor.h --- dvdauthor-0.6.11.orig/src/dvdauthor.h 2005-01-31 20:26:19.000000000 -0600 +++ dvdauthor-0.6.11/src/dvdauthor.h 2005-04-25 19:46:01.722217920 -0500 @@ -65,6 +65,7 @@ void dvdauthor_enable_jumppad(); void dvdauthor_vts_gen(struct menugroup *menus,struct pgcgroup *titles,char *fbase); void dvdauthor_vmgm_gen(struct pgc *fpc,struct menugroup *menus,char *fbase); +void dvdauthor_enable_warnings(); #ifdef __cplusplus } diff -urN dvdauthor-0.6.11.orig/src/dvdcli.c dvdauthor-0.6.11/src/dvdcli.c --- dvdauthor-0.6.11.orig/src/dvdcli.c 2005-01-31 20:26:19.000000000 -0600 +++ dvdauthor-0.6.11/src/dvdcli.c 2005-04-25 19:46:44.811667328 -0500 @@ -232,6 +232,8 @@ "\n\t-x XMLFILE where XMLFILE is a configuration file describing the\n" "\t structure of the DVD to create. If you use a config file, then you\n" "\t do not need to specify any other options, except -o.\n" + "\n\t-w will turn on the WARN: messages telling you to re-multiplex\n" + "\t the audio and/or video.\n" "\n\t" LONGOPT("--video=VOPTS or ") "-v VOPTS where VOPTS is a plus (+) separated list of\n" "\t video options. dvdauthor will try to infer any unspecified options.\n" "\t\tpal, ntsc, 4:3, 16:9, 720xfull, 720x576, 720x480, 704xfull,\n" @@ -360,7 +362,7 @@ while(1) { struct pgcgroup *vc=va[curva]; - int c=GETOPTFUNC(argc,argv,"f:o:v:a:s:hc:Cp:Pmtb:Ti:e:x:"); + int c=GETOPTFUNC(argc,argv,"f:o:v:a:s:hc:Cp:Pmtb:Ti:e:x:w"); if( c == -1 ) break; switch(c) { @@ -492,6 +494,10 @@ source_add_cell(curvob,0,-1,1,0,0); break; + case 'w': + dvdauthor_enable_warnings(); + break; + default: fprintf(stderr,"ERR: getopt returned bad code %d\n",c); return 1; diff -urN dvdauthor-0.6.11.orig/src/dvdvob.c dvdauthor-0.6.11/src/dvdvob.c --- dvdauthor-0.6.11.orig/src/dvdvob.c 2005-02-10 14:47:32.000000000 -0600 +++ dvdauthor-0.6.11/src/dvdvob.c 2005-04-25 19:56:33.257210008 -0500 @@ -812,6 +812,7 @@ FILE *h; int cursect=0,fsect=-1,vnum,outnum=-ismenu+1; int ispipe,vobid=0; + int audioDiscontinuityCount=0, audioBackwardsCount=0, audioPrevCurrSectorCount=0; struct mp2info { int hdrptr; unsigned char buf[6]; @@ -1155,11 +1156,26 @@ if( ach->audpts[ach->numaudpts-1].pts[1]=32 ) goto noshow; - fprintf(stderr,"WARN: Discontinuity in audio channel %d; please remultiplex input.\n",audch); - } else if( ach->audpts[ach->numaudpts-1].pts[1]>pts0 ) - fprintf(stderr,"WARN: Audio pts for channel %d moves backwards; please remultiplex input.\n",audch); + if (printWarnings || audioDiscontinuityCount == 0) + { + fprintf(stderr,"WARN: Discontinuity in audio channel %d; please remultiplex input.\n",audch); + audioDiscontinuityCount++; + } + else + audioDiscontinuityCount++; + } else if( ach->audpts[ach->numaudpts-1].pts[1]>pts0 ) { + if (printWarnings || audioBackwardsCount == 0) + { + fprintf(stderr,"WARN: Audio pts for channel %d moves backwards; please remultiplex input.\n",audch); + audioBackwardsCount++; + } + else + audioBackwardsCount++; + } else goto noshow; + if (printWarnings || audioPrevCurrSectorCount == 0) + { fprintf(stderr,"WARN: Previous sector: "); printpts(ach->audpts[ach->numaudpts-1].pts[0]); fprintf(stderr," - "); @@ -1169,6 +1185,10 @@ fprintf(stderr," - "); printpts(pts1); fprintf(stderr,"\n"); + audioPrevCurrSectorCount++; + } + else + audioPrevCurrSectorCount++; ach->audpts[ach->numaudpts-1].pts[1]=pts0; } noshow: @@ -1344,6 +1364,18 @@ writeclose(); printvobustatus(va,cursect); fprintf(stderr,"\n"); + if (audioDiscontinuityCount > 0) + { + fprintf(stderr, "%d Audio Discontinuity WARNings generated.\n", audioDiscontinuityCount); + } + if (audioBackwardsCount > 0) + { + fprintf(stderr, "%d Audio Moving Backwards WARNings generated.\n", audioBackwardsCount); + } + if (audioPrevCurrSectorCount > 0) + { + fprintf(stderr, "%d Audio Previous/Current sector WARNings generated.\n", audioPrevCurrSectorCount); + } free(crs); return 1; } @@ -1544,6 +1576,7 @@ pts_t scr; int vff,vrew,totvob,curvob; unsigned char *buf; + int audioSectorCount = 0; totvob=0; for( pn=0; pnnumvobs; pn++ ) @@ -1640,9 +1673,15 @@ if( s>=0 ) { s=s-vi->sector; if( s > 0x1fff || s < -(0x1fff)) { - fprintf(stderr,"\nWARN: audio sector out of range: %d (vobu #%d, pts ",s,i); - printpts(vi->sectpts[0]); - fprintf(stderr,")\n"); + if (printWarnings || audioSectorCount == 0) + { + fprintf(stderr,"\nWARN: audio sector out of range: %d (vobu #%d, pts ",s,i); + printpts(vi->sectpts[0]); + fprintf(stderr,")\n"); + audioSectorCount++; + } + else + audioSectorCount++; s=0; } if( s < 0 ) @@ -1711,6 +1750,10 @@ } if( h>=0 ) close(h); + if (audioSectorCount > 0) + { + fprintf(stderr, "%d audio sector out of range WARNings generated.\n", audioSectorCount); + } if( totvob>0 ) fprintf(stderr,"STAT: fixed %d VOBUS ",totvob); fprintf(stderr,"\n");