Index: mpeg2fix.cpp
===================================================================
--- mpeg2fix.cpp	(revision 8690)
+++ mpeg2fix.cpp	(working copy)
@@ -196,7 +196,7 @@
 MPEG2fixup::MPEG2fixup(const char *inf, const char *outf,
                        QMap<long long, int> *deleteMap,
                        const char *fmt, int norp, int fixPTS, int maxf,
-                       bool showprog)
+                       bool showprog, int otype)
 {
     displayFrame = new QPtrListIterator<MPEG2frame> (vFrame);
 
@@ -207,6 +207,7 @@
     no_repeat = norp;
     fix_PTS = fixPTS;
     maxframes = maxf;
+    rx.otype = otype;
 
     real_file_end = file_end = false;
 
@@ -506,8 +507,6 @@
     int video_delay = 0, audio_delay = 0;
     int fd_out;
 
-    int otype = REPLEX_MPEG2;
-
     memset(&mx, 0, sizeof(mx));
     memset(ext_ok, 0, sizeof(ext_ok));
 
@@ -2256,6 +2255,7 @@
     fprintf(stderr, "\t--cutlist \"start - end\" -c : Apply a cutlist.  Specify on e'-c' per cut\n");
     fprintf(stderr, "\t--no3to2           -t        : Remove 3:2 pullup\n");
     fprintf(stderr, "\t--fixup            -f        : make PTS contiuous\n");
+    fprintf(stderr, "\t--dvd              -n        : Insert DVD NAV packets\n");
     fprintf(stderr, "\t--showprogress     -p        : show progress\n");
     fprintf(stderr, "\t--help             -h        : This screen\n");
     exit(0);
@@ -2266,7 +2266,7 @@
     QStringList cutlist;
     QStringList savelist;
     char *infile = NULL, *outfile = NULL, *format = NULL;
-    int no_repeat = 0, fix_PTS = 0, max_frames = 20;
+    int no_repeat = 0, fix_PTS = 0, max_frames = 20, otype = REPLEX_MPEG2;
     bool showprogress = 0;
     const struct option long_options[] =
         {
@@ -2279,6 +2279,7 @@
             {"saveframe", required_argument, NULL, 's'},
             {"no3to2", no_argument, NULL, 't'},
             {"fixup", no_argument, NULL, 'f'},
+            {"dvd", no_argument, NULL, 'n'},
             {"showprogress", no_argument, NULL, 'p'},
             {"help", no_argument , NULL, 'h'},
             {0, 0, 0, 0}
@@ -2288,7 +2289,7 @@
     {
         int option_index = 0;
         char c;
-        c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tfph",
+        c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tfnph",
                          long_options, &option_index);
 
         if (c == -1)
@@ -2327,6 +2328,11 @@
             case 'f':
                 fix_PTS = 1;
                 break;
+
+            case 'n':
+                otype = REPLEX_DVD;
+                break;
+
             case 's':
                 savelist.append(optarg);
                 break;
@@ -2349,7 +2355,7 @@
 
     MPEG2fixup m2f(infile, outfile, NULL, format, 
                    no_repeat, fix_PTS, max_frames,
-                   showprogress);
+                   showprogress, otype);
 
     if (cutlist.count())
         m2f.AddRangeList(cutlist, MPF_TYPE_CUTLIST);
Index: main.cpp
===================================================================
--- main.cpp	(revision 8690)
+++ main.cpp	(working copy)
@@ -33,6 +33,7 @@
     cerr << "\t<--starttime <starttime>> <--profile <profile>>\n";
     cerr << "\t[options]\n\n";
     cerr << "\t--mpeg2          or -m: Perform MPEG2 to MPEG2 transcode.\n";
+    cerr << "\t--dvd            or -n: Insert DVD NAV packets.\n";
     cerr << "\t--chanid         or -c: Takes a channel id. REQUIRED\n";
     cerr << "\t--starttime      or -s: Takes a starttime for the\n";
     cerr << "\t                        recording. REQUIRED\n";
@@ -60,6 +61,7 @@
     QString profilename = QString("autodetect");
     QString fifodir = NULL;
     int jobID = -1;
+    int otype = REPLEX_MPEG2;
     bool useCutlist = false, keyframesonly = false;
     bool build_index = false, fifosync = false, showprogress = false, mpeg2 = false;
     QMap<long long, int> deleteMap;
@@ -272,6 +274,11 @@
         {
             mpeg2 = true;
         }
+        else if (!strcmp(a.argv()[argpos],"-n") ||
+                 !strcmp(a.argv()[argpos],"--dvd")) 
+        {
+            otype = REPLEX_DVD;
+        }
         else if (!strcmp(a.argv()[argpos],"-h") ||
                  !strcmp(a.argv()[argpos],"--help")) 
         {
@@ -401,7 +408,7 @@
        
         MPEG2fixup *m2f = new MPEG2fixup(infile.ascii(), outfile.ascii(),
                                          &deleteMap, NULL, false, false, 20,
-                                         showprogress);
+                                         showprogress, otype);
         if (build_index)
         {
             int err = BuildKeyframeIndex(m2f, infile, posMap, jobID);
Index: mpeg2fix.h
===================================================================
--- mpeg2fix.h	(revision 8690)
+++ mpeg2fix.h	(working copy)
@@ -107,6 +107,7 @@
     int WaitBuffers();
     int done;
     QString outfile;
+    int otype;
     ringbuffer vrbuf;
     ringbuffer extrbuf[N_AUDIO];
     ringbuffer index_vrbuf;
@@ -129,7 +130,7 @@
   public:
     MPEG2fixup(const char *inf, const char *outf,
                QMap<long long, int> *deleteMap, const char *fmt, int norp,
-               int fixPTS, int maxf, bool showprog);
+               int fixPTS, int maxf, bool showprog, int otype);
     ~MPEG2fixup();
     int Start();
     void AddRangeList(QStringList cutlist, int type);
