diff -urN dvdauthor-0.6.12-alpha-2992.orig/src/da-internal.h dvdauthor-0.6.12-alpha-2992/src/da-internal.h --- dvdauthor-0.6.12-alpha-2992.orig/src/da-internal.h 2005-03-04 17:50:50.000000000 -0600 +++ dvdauthor-0.6.12-alpha-2992/src/da-internal.h 2005-04-25 20:36:15.735018328 -0500 @@ -174,6 +174,7 @@ extern char *entries[]; extern int jumppad, allowallreg; 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.12-alpha-2992.orig/src/dvdauthor.c dvdauthor-0.6.12-alpha-2992/src/dvdauthor.c --- dvdauthor-0.6.12-alpha-2992.orig/src/dvdauthor.c 2005-03-04 18:12:03.000000000 -0600 +++ dvdauthor-0.6.12-alpha-2992/src/dvdauthor.c 2005-04-25 20:36:15.737018024 -0500 @@ -42,6 +42,12 @@ // prohibits certain convenience features int allowallreg=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}; @@ -1239,6 +1245,11 @@ allowallreg=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.12-alpha-2992.orig/src/dvdauthor.h dvdauthor-0.6.12-alpha-2992/src/dvdauthor.h --- dvdauthor-0.6.12-alpha-2992.orig/src/dvdauthor.h 2005-03-04 15:49:45.000000000 -0600 +++ dvdauthor-0.6.12-alpha-2992/src/dvdauthor.h 2005-04-25 20:36:15.737018024 -0500 @@ -69,6 +69,7 @@ void dvdauthor_enable_allgprm(); 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.12-alpha-2992.orig/src/dvdcli.c dvdauthor-0.6.12-alpha-2992/src/dvdcli.c --- dvdauthor-0.6.12-alpha-2992.orig/src/dvdcli.c 2005-03-04 16:38:01.000000000 -0600 +++ dvdauthor-0.6.12-alpha-2992/src/dvdcli.c 2005-04-25 20:36:48.556028776 -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" @@ -365,7 +367,7 @@ while(1) { struct pgcgroup *vc=va[curva]; - int c=GETOPTFUNC(argc,argv,"f:o:v:a:s:hc:Cp:Pmtb:Ti:e:x:jg"); + int c=GETOPTFUNC(argc,argv,"f:o:v:a:s:hc:Cp:Pmtb:Ti:e:x:jgw"); if( c == -1 ) break; switch(c) { @@ -501,6 +503,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.12-alpha-2992.orig/src/dvdvob.c dvdauthor-0.6.12-alpha-2992/src/dvdvob.c --- dvdauthor-0.6.12-alpha-2992.orig/src/dvdvob.c 2005-03-04 18:12:03.000000000 -0600 +++ dvdauthor-0.6.12-alpha-2992/src/dvdvob.c 2005-04-25 20:36:15.741017416 -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]; @@ -1165,11 +1166,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," - "); @@ -1179,6 +1195,10 @@ fprintf(stderr," - "); printpts(pts1); fprintf(stderr,"\n"); + audioPrevCurrSectorCount++; + } + else + audioPrevCurrSectorCount++; ach->audpts[ach->numaudpts-1].pts[1]=pts0; } noshow: @@ -1357,6 +1377,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; } @@ -1557,6 +1589,7 @@ pts_t scr; int vff,vrew,totvob,curvob; unsigned char *buf; + int audioSectorCount = 0; totvob=0; for( pn=0; pnnumvobs; pn++ ) @@ -1690,9 +1723,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 ) @@ -1761,6 +1800,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");