Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 193865 | Differences between
and this patch

Collapse All | Expand All

(-)vdrrip-0.3.0/a-tools.c (-1 / +4 lines)
Lines 108-111 Link Here
108
  return s1;
108
  return s1;
109
}
109
}
110
110
111
int roundValue(int i, int i1) {return i / i1 * i1;}
111
int roundValue(int i, int i1) {
112
  if (i%i1 > i1/2) {return (i/i1*i1+i1);}
113
  else {return (i/i1*i1);}
114
}
(-)vdrrip-0.3.0/codecs.c (-5 / +5 lines)
Lines 66-74 Link Here
66
          // move found video codec to VCodecs[i1]
66
          // move found video codec to VCodecs[i1]
67
          char *tmp = VCodecs[c1];
67
          char *tmp = VCodecs[c1];
68
          VCodecs[c1] = VCodecs[c];
68
          VCodecs[c1] = VCodecs[c];
69
	  VCodecs[c] = tmp;
69
          VCodecs[c] = tmp;
70
          c1++;
70
          c1++;
71
	  NumVCodecs++;
71
          NumVCodecs++;
72
        }
72
        }
73
      }
73
      }
74
    }
74
    }
Lines 91-99 Link Here
91
          // switch found audio codec with ACodecs[i1]
91
          // switch found audio codec with ACodecs[i1]
92
          char *tmp = ACodecs[c1];
92
          char *tmp = ACodecs[c1];
93
          ACodecs[c1] = ACodecs[c];
93
          ACodecs[c1] = ACodecs[c];
94
	  ACodecs[c] = tmp;
94
          ACodecs[c] = tmp;
95
	  c1++;
95
          c1++;
96
	  NumACodecs++;
96
          NumACodecs++;
97
        }
97
        }
98
      }
98
      }
99
    }
99
    }
(-)vdrrip-0.3.0/i18n.c (-3 / +66 lines)
Lines 613-619 Link Here
613
  },
613
  },
614
614
615
  { "expert modus(off)",
615
  { "expert modus(off)",
616
    "Exp.-Modus(aus)",
616
    "Einfach",
617
    "",// TODO
617
    "",// TODO
618
    "Modo esperto(off)",
618
    "Modo esperto(off)",
619
    "",// TODO
619
    "",// TODO
Lines 634-640 Link Here
634
  },
634
  },
635
635
636
  { "expert modus(on)",
636
  { "expert modus(on)",
637
    "Exp.-Modus(ein)",
637
    "Experte",
638
    "",// TODO
638
    "",// TODO
639
    "Modo esperto(on)",
639
    "Modo esperto(on)",
640
    "",// TODO
640
    "",// TODO
Lines 718-724 Link Here
718
  },
718
  },
719
719
720
  { "CropData",
720
  { "CropData",
721
    "Schnitt-Daten",
721
    "Bildschnitt-Info",
722
    "",// TODO
722
    "",// TODO
723
    "Valori di taglio",
723
    "Valori di taglio",
724
    "",// TODO
724
    "",// TODO
Lines 738-743 Link Here
738
#endif
738
#endif
739
  },
739
  },
740
  
740
  
741
  { "RangeData",
742
    "Zeitlaufgrenzen",
743
    "",// TODO
744
    "",// TODO
745
    "",// TODO
746
    "",// TODO
747
    "",// TODO
748
    "",// TODO
749
    "",// TODO
750
    "",// TODO
751
    "",// TODO
752
    "",// TODO
753
    "",// TODO
754
    "",// TODO
755
    "",// TODO
756
    "",// TODO
757
#if VDRVERSNUM>10301
758
    "",// TODO
759
#endif
760
  },
761
  
741
  { "ScaleData",
762
  { "ScaleData",
742
    "Skalierung",
763
    "Skalierung",
743
    "",// TODO
764
    "",// TODO
Lines 885-890 Link Here
885
#endif
906
#endif
886
  },
907
  },
887
908
909
  { "CropPosX",
910
    "Startspalte",// TODO
911
    "",// TODO
912
    "",// TODO
913
    "",// TODO
914
    "",// TODO
915
    "",// TODO
916
    "",// TODO
917
    "",// TODO
918
    "",// TODO
919
    "",// TODO
920
    "",// TODO
921
    "",// TODO
922
    "",// TODO
923
    "",// TODO
924
    "",// TODO
925
#if VDRVERSNUM>10301
926
    "",// TODO
927
#endif
928
  },
929
930
  { "CropPosY",
931
    "Startzeile",// TODO
932
    "",// TODO
933
    "",// TODO
934
    "",// TODO
935
    "",// TODO
936
    "",// TODO
937
    "",// TODO
938
    "",// TODO
939
    "",// TODO
940
    "",// TODO
941
    "",// TODO
942
    "",// TODO
943
    "",// TODO
944
    "",// TODO
945
    "",// TODO
946
#if VDRVERSNUM>10301
947
    "",// TODO
948
#endif
949
  },
950
888
  { "- postprocessing Filters(%s):",
951
  { "- postprocessing Filters(%s):",
889
    "- Nachbearbeitungsfilter(%s):",
952
    "- Nachbearbeitungsfilter(%s):",
890
    "",// TODO
953
    "",// TODO
(-)vdrrip-0.3.0/menu-vdrrip.c (-76 / +208 lines)
Lines 4-9 Link Here
4
4
5
#include <vdr/plugin.h>
5
#include <vdr/plugin.h>
6
#include <vdr/videodir.h>
6
#include <vdr/videodir.h>
7
#if VDRVERSNUM >= 10307
8
#include <vdr/interface.h>
9
#include <vdr/recording.h>
10
#include <vdr/status.h>
11
#endif
7
12
8
#ifdef VDRRIP_DVD
13
#ifdef VDRRIP_DVD
9
  #include <dvdnav/ifo_read.h>
14
  #include <dvdnav/ifo_read.h>
Lines 16-32 Link Here
16
#include "queue.h"
21
#include "queue.h"
17
#include "vdrriprecordings.h"
22
#include "vdrriprecordings.h"
18
23
24
#define ABS(i) ((i)<0?-(i):(i))
19
#define MINQUANT 2
25
#define MINQUANT 2
20
#define MAXQUANT 15
26
#define MAXQUANT 15
21
27
22
#define NUMSCALETYPES 4
28
#define NUMSCALETYPES 4
23
#define NUMPPDEINT 6
29
#define NUMPPDEINT 8
24
30
25
static const char *ScaleTypes[] = { "off", "auto", "dvb", "manual" };
31
static const char *ScaleTypes[] = { "off", "auto", "dvb", "manual" };
26
static const char *DVBScaleWidths[] = { "352", "480", "544", "688", "704", "720" };
32
static const char *DVBScaleWidths[] = { "352", "480", "544", "688", "704", "720" };
27
static const char *DVBScaleHeights[] = { "288", "576" };
33
static const char *DVBScaleHeights[] = { "288", "576" };
28
static const char *CropModes[] = { "crop width & height", "crop only height"};
34
static const char *CropModes[] = { "crop width & height", "crop only height"};
29
static const char *PPDeint[] = { "off", "fd", "lb", "li", "ci", "md", };
35
static const char *PPDeint[] = { "off", "codec_does_il", "fd", "lb", "li", "ci", "md", "l5" };
30
36
31
// --- cMenuVdrrip ---------------------------------------------------------
37
// --- cMenuVdrrip ---------------------------------------------------------
32
38
Lines 92-105 Link Here
92
# ifdef VDRRIP_DVD
98
# ifdef VDRRIP_DVD
93
99
94
cMenuVdrripWarning::cMenuVdrripWarning(const char *Title, const char *Text)
100
cMenuVdrripWarning::cMenuVdrripWarning(const char *Title, const char *Text)
101
#if VDRVERSNUM >= 10307
102
:cMenuText(Title, "")
103
#else
95
:cOsdMenu(Title)
104
:cOsdMenu(Title)
105
#endif
96
{
106
{
97
  bool warning;
107
  bool warning;
98
  warning = true;
108
  warning = true;
99
  //warning = false;
109
  //warning = false;
100
110
101
  if (warning) {
111
  if (warning) {
112
#if VDRVERSNUM >= 10307
113
    SetText(Text);
114
#else
102
    Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, fontOsd));
115
    Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, fontOsd));
116
#endif
103
    SetHelp(tr("back"), tr("accept"), NULL, NULL);
117
    SetHelp(tr("back"), tr("accept"), NULL, NULL);
104
    hadsubmenu = false;
118
    hadsubmenu = false;
105
  } else {
119
  } else {
Lines 120-125 Link Here
120
  if (hadsubmenu) {return osBack;}
134
  if (hadsubmenu) {return osBack;}
121
  
135
  
122
  switch (Key) {
136
  switch (Key) {
137
#if VDRVERSNUM >= 10307
138
    // cMenuText::ProcessKey don't handle submenus
139
    case kUp|k_Repeat:
140
    case kUp:
141
    case kDown|k_Repeat:
142
    case kDown:
143
    case kLeft|k_Repeat:
144
    case kLeft:
145
    case kRight|k_Repeat:
146
    case kRight:
147
      DisplayMenu()->Scroll(NORMALKEY(Key) == kUp || NORMALKEY(Key) == kLeft,
148
                            NORMALKEY(Key) == kLeft || NORMALKEY(Key) == kRight);
149
      cStatus::MsgOsdTextItem(NULL, NORMALKEY(Key) == kUp);
150
      return osContinue;
151
#endif
152
123
    case kRed: return osBack;
153
    case kRed: return osBack;
124
154
125
    case kGreen: {
155
    case kGreen: {
Lines 138-150 Link Here
138
  ifo_handle_t *ifo_zero = NULL;
168
  ifo_handle_t *ifo_zero = NULL;
139
  ifo_handle_t *ifo_tmp = NULL;
169
  ifo_handle_t *ifo_tmp = NULL;
140
170
171
#if VDRVERSNUM >= 10307
172
  Skins.Message(mtStatus, tr("checking dvd..."));
173
  Skins.Flush();
174
#else
141
  Interface->Status(tr("checking dvd..."));
175
  Interface->Status(tr("checking dvd..."));
142
  Interface->Flush();
176
  Interface->Flush();
177
#endif
143
178
144
  if (access(DVD, R_OK) == -1) {
179
  if (access(DVD, R_OK) == -1) {
145
    char *s = NULL;
180
    char *s = NULL;
146
    asprintf(&s, "No read privileges on %s !", DVD);
181
    asprintf(&s, "No read privileges on %s !", DVD);
182
#if VDRVERSNUM >= 10307
183
    Skins.Message(mtError, s);
184
#else
147
    Interface->Error(s);
185
    Interface->Error(s);
186
#endif
148
    FREE(s);
187
    FREE(s);
149
    return false;
188
    return false;
150
  }
189
  }
Lines 157-169 Link Here
157
      for (int i = 1; i < ifo_zero->vts_atrt->nr_of_vtss; i++) {
196
      for (int i = 1; i < ifo_zero->vts_atrt->nr_of_vtss; i++) {
158
        ifo_tmp = ifoOpen(dvd, i);
197
        ifo_tmp = ifoOpen(dvd, i);
159
        if (ifo_tmp) ifoClose(ifo_tmp);
198
        if (ifo_tmp) ifoClose(ifo_tmp);
160
	else {
199
        else {
161
	  char *s = NULL;
200
          char *s = NULL;
162
	  asprintf(&s, "Can't open ifo %d !", i);
201
          asprintf(&s, "Can't open ifo %d !", i);
163
	  Interface->Error(s);
202
#if VDRVERSNUM >= 10307
164
	  FREE(s);
203
          Skins.Message(mtError, s);
204
#else
205
          Interface->Error(s);
206
#endif
207
          FREE(s);
165
          DVDClose(dvd);
208
          DVDClose(dvd);
166
	  return false;
209
          return false;
167
        }
210
        }
168
      }
211
      }
169
      ifoClose(ifo_zero);
212
      ifoClose(ifo_zero);
Lines 171-184 Link Here
171
      return true;
214
      return true;
172
    } else {
215
    } else {
173
      DVDClose(dvd);
216
      DVDClose(dvd);
217
#if VDRVERSNUM >= 10307
218
      Skins.Message(mtError, "Can't open main ifo from dvd !");
219
#else
174
      Interface->Error("Can't open main ifo from dvd !");
220
      Interface->Error("Can't open main ifo from dvd !");
221
#endif
175
      return false;
222
      return false;
176
    }
223
    }
177
  }
224
  }
178
 
225
 
179
  char *s = NULL;
226
  char *s = NULL;
180
  asprintf(&s, "Can 't open %s !", DVD);
227
  asprintf(&s, "Can 't open %s !", DVD);
228
#if VDRVERSNUM >= 10307
229
  Skins.Message(mtError, s);
230
#else
181
  Interface->Error(s);
231
  Interface->Error(s);
232
#endif
182
  FREE(s);
233
  FREE(s);
183
  return false;
234
  return false;
184
}
235
}
Lines 190-197 Link Here
190
cMenuVdrripEncode::cMenuVdrripEncode():cOsdMenu(tr("encode vdr-recording")) {
241
cMenuVdrripEncode::cMenuVdrripEncode():cOsdMenu(tr("encode vdr-recording")) {
191
  R = NULL;
242
  R = NULL;
192
  
243
  
244
#if VDRVERSNUM >= 10307
245
  Skins.Message(mtStatus, tr("scanning recordings..."));
246
  Skins.Flush();
247
#else
193
  Interface->Status(tr("scanning recordings..."));
248
  Interface->Status(tr("scanning recordings..."));
194
  Interface->Flush();
249
  Interface->Flush();
250
#endif
195
251
196
  R = new cVdrripRecordings;
252
  R = new cVdrripRecordings;
197
  Set();
253
  Set();
Lines 259-265 Link Here
259
    FREE(s1);
315
    FREE(s1);
260
  }
316
  }
261
317
262
  if (Q->getLockStat()) {Interface->Error(tr("the queuefile is locked by the queuehandler !"));}
318
  if (Q->getLockStat()) {
319
#if VDRVERSNUM >= 10307
320
    Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !"));
321
#else
322
    Interface->Error(tr("the queuefile is locked by the queuehandler !"));
323
#endif
324
  }
263
325
264
  SetHelpKeys();
326
  SetHelpKeys();
265
}
327
}
Lines 284-291 Link Here
284
        char *buf = NULL;
346
        char *buf = NULL;
285
        asprintf(&buf, tr("delete movie %s from queue ?"), Q->getShortname(NumMovie));
347
        asprintf(&buf, tr("delete movie %s from queue ?"), Q->getShortname(NumMovie));
286
        if (Interface->Confirm(buf)) {
348
        if (Interface->Confirm(buf)) {
287
	  Q->Del(NumMovie);
349
          Q->Del(NumMovie);
288
	  RefreshOSD();
350
          RefreshOSD();
289
        }
351
        }
290
        FREE(buf);
352
        FREE(buf);
291
      }
353
      }
Lines 294-300 Link Here
294
356
295
    case kGreen: {
357
    case kGreen: {
296
      if (Up) {
358
      if (Up) {
297
	Q->Up(NumMovie);
359
        Q->Up(NumMovie);
298
        RefreshOSD();
360
        RefreshOSD();
299
      }
361
      }
300
      break;
362
      break;
Lines 315-324 Link Here
315
      }
377
      }
316
      break;
378
      break;
317
    }
379
    }
318
		   
380
                   
319
    default: break;
381
    default: break;
320
  }
382
  }
321
		 
383
                 
322
  return state;
384
  return state;
323
}
385
}
324
386
Lines 353-363 Link Here
353
}
415
}
354
416
355
void cMenuVdrripQueue::AddColItem(cOsdItem *i) {
417
void cMenuVdrripQueue::AddColItem(cOsdItem *i) {
418
#if VDRVERSNUM < 10307
356
#ifdef clrScrolLine
419
#ifdef clrScrolLine
357
   i->SetColor(clrScrolLine, clrBackground);
420
   i->SetColor(clrScrolLine, clrBackground);
358
#else
421
#else
359
   i->SetColor(clrCyan, clrBackground);
422
   i->SetColor(clrCyan, clrBackground);
360
#endif
423
#endif
424
#endif
361
425
362
  Add(i);
426
  Add(i);
363
}
427
}
Lines 491-504 Link Here
491
    Add(new cMenuEditIntItem(tr("BitrateAudio"), &TempOSD.BitrateAudio, 1, 9999));
555
    Add(new cMenuEditIntItem(tr("BitrateAudio"), &TempOSD.BitrateAudio, 1, 9999));
492
  }
556
  }
493
  Add(new cMenuEditStraItem(tr("Container"), &TempOSD.Container,
557
  Add(new cMenuEditStraItem(tr("Container"), &TempOSD.Container,
494
                            T->C->getNumContainers(), T->C->getContainers()));	
558
                            T->C->getNumContainers(), T->C->getContainers()));  
495
  Add(new cMenuEditStraItem(tr("Video-Codec"), &TempOSD.VCodec, 
559
  Add(new cMenuEditStraItem(tr("Video-Codec"), &TempOSD.VCodec, 
496
			    T->C->getNumVCodecs(), T->C->getVCodecs()));
560
                            T->C->getNumVCodecs(), T->C->getVCodecs()));
497
  Add(new cMenuEditStraItem(tr("Audio-Codec"), &TempOSD.ACodec,
561
  Add(new cMenuEditStraItem(tr("Audio-Codec"), &TempOSD.ACodec,
498
			    T->C->getNumACodecs(), T->C->getACodecs()));
562
                            T->C->getNumACodecs(), T->C->getACodecs()));
499
  Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &TempOSD.Bpp, 1, 99));
563
  Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &TempOSD.Bpp, 1, 99));
500
  Add(new cMenuEditStraItem(tr("ScaleType"), &TempOSD.ScaleType,
564
  Add(new cMenuEditStraItem(tr("ScaleType"), &TempOSD.ScaleType,
501
	                    NUMSCALETYPES, ScaleTypes));
565
                            NUMSCALETYPES, ScaleTypes));
502
}
566
}
503
567
504
void cMenuVdrripEditTemplate::OSDChange() {
568
void cMenuVdrripEditTemplate::OSDChange() {
Lines 520-526 Link Here
520
584
521
  } else if (TempOSD.ACodec != TempOSDsave.ACodec) {
585
  } else if (TempOSD.ACodec != TempOSDsave.ACodec) {
522
    if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 &&
586
    if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 &&
523
	strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) {
587
        strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) {
524
      // avi couldn't contain ogg-vorbis audio
588
      // avi couldn't contain ogg-vorbis audio
525
      T->setCodecs(NumTemplate, TempOSD.VCodec, TempOSDsave.ACodec);
589
      T->setCodecs(NumTemplate, TempOSD.VCodec, TempOSDsave.ACodec);
526
    } else {
590
    } else {
Lines 531-537 Link Here
531
595
532
  } else if (TempOSD.Container != TempOSDsave.Container) {
596
  } else if (TempOSD.Container != TempOSDsave.Container) {
533
    if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 &&
597
    if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 &&
534
	strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) {
598
        strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) {
535
      // avi couldn't contain ogg-vorbis audio
599
      // avi couldn't contain ogg-vorbis audio
536
      T->setContainer(NumTemplate, TempOSDsave.Container);
600
      T->setContainer(NumTemplate, TempOSDsave.Container);
537
    } else {
601
    } else {
Lines 573-579 Link Here
573
637
574
      default: {
638
      default: {
575
        OSDupdate = true;
639
        OSDupdate = true;
576
	break;
640
        break;
577
      }
641
      }
578
    }
642
    }
579
  }
643
  }
Lines 584-594 Link Here
584
}
648
}
585
649
586
void cMenuVdrripEditTemplate::AddColItem(cOsdItem *i) {
650
void cMenuVdrripEditTemplate::AddColItem(cOsdItem *i) {
651
#if VDRVERSNUM < 10307
587
#ifdef clrScrolLine
652
#ifdef clrScrolLine
588
   i->SetColor(clrScrolLine, clrBackground);
653
   i->SetColor(clrScrolLine, clrBackground);
589
#else
654
#else
590
   i->SetColor(clrCyan, clrBackground);
655
   i->SetColor(clrCyan, clrBackground);
591
#endif
656
#endif
657
#endif
592
658
593
  Add(i);
659
  Add(i);
594
}
660
}
Lines 600-607 Link Here
600
  MovOSDsaveName = NULL;
666
  MovOSDsaveName = NULL;
601
  FileSize[0] = MovieData[0] = CropData[0] = ScaleData[0] = NULL;
667
  FileSize[0] = MovieData[0] = CropData[0] = ScaleData[0] = NULL;
602
  
668
  
669
#if VDRVERSNUM >= 10307
670
  Skins.Message(mtStatus, tr("reading movie-data..."));
671
  Skins.Flush();
672
#else
603
  Interface->Status(tr("reading movie-data..."));
673
  Interface->Status(tr("reading movie-data..."));
604
  Interface->Flush();
674
  Interface->Flush();
675
#endif
605
676
606
  M = new cMovie(p, n);
677
  M = new cMovie(p, n);
607
  Init(); 
678
  Init(); 
Lines 633-651 Link Here
633
  if (M->getScaleType() == 2) {
704
  if (M->getScaleType() == 2) {
634
    for (int i = 0; i < 6; i++) {
705
    for (int i = 0; i < 6; i++) {
635
      if (atoi(DVBScaleWidths[i]) == M->getScaleWidth()) {
706
      if (atoi(DVBScaleWidths[i]) == M->getScaleWidth()) {
636
	MovOSD.DVBScaleWidth = i;
707
        MovOSD.DVBScaleWidth = i;
637
      }
708
      }
638
    }
709
    }
639
    
710
    
640
    for (int i = 0; i < 2; i++) {
711
    for (int i = 0; i < 2; i++) {
641
      if (atoi(DVBScaleHeights[i]) == M->getScaleHeight()) {
712
      if (atoi(DVBScaleHeights[i]) == M->getScaleHeight()) {
642
	MovOSD.DVBScaleHeight = i;
713
        MovOSD.DVBScaleHeight = i;
643
      }
714
      }
644
    }
715
    }
645
  }    
716
  }    
646
717
647
  CropWidthsave  = -1;
718
  CropWidthsave  = -1;
648
  CropHeightsave = -1;
719
  CropHeightsave = -1;
720
  CropPosXsave   = -1;
721
  CropPosYsave   = -1;
649
722
650
  MovOSD.PPDeinterlace = 0;
723
  MovOSD.PPDeinterlace = 0;
651
  MovOSD.PPDeblock = 0;
724
  MovOSD.PPDeblock = 0;
Lines 675-686 Link Here
675
748
676
  MovOSD.CropWidth      = M->getCropWidth();
749
  MovOSD.CropWidth      = M->getCropWidth();
677
  MovOSD.CropHeight     = M->getCropHeight();
750
  MovOSD.CropHeight     = M->getCropHeight();
751
  MovOSD.CropPosX       = M->getCropPosX();
752
  MovOSD.CropPosY       = M->getCropPosY();
678
  if (M->getPPValues()) {
753
  if (M->getPPValues()) {
679
    if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 1;
754
         if (strstr(M->getPPValues(), "off")) MovOSD.PPDeinterlace = 0;
680
    else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 2;
755
    else if (strstr(M->getPPValues(), "codec_does_il")) MovOSD.PPDeinterlace = 1;
681
    else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 3;
756
    else if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 2;
682
    else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 4;
757
    else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 3;
683
    else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 5;
758
    else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 4;
759
    else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 5;
760
    else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 6;
761
    else if (strstr(M->getPPValues(), "l5")) MovOSD.PPDeinterlace = 7;
684
    else MovOSD.PPDeinterlace = 0;
762
    else MovOSD.PPDeinterlace = 0;
685
763
686
    if (strstr(M->getPPValues(), "hb/vb/dr/al")) MovOSD.PPDeblock = 1;
764
    if (strstr(M->getPPValues(), "hb/vb/dr/al")) MovOSD.PPDeblock = 1;
Lines 716-724 Link Here
716
                                                        CropReset = true;
794
                                                        CropReset = true;
717
795
718
    SetHelp(tr("add to queue"), 
796
    SetHelp(tr("add to queue"), 
719
	    Crop ? tr(CropReset ? "reset boarders" : "crop boarders" ) : NULL,
797
            Crop ? tr(CropReset ? "reset boarders" : "crop boarders" ) : NULL,
720
	    tr(Expert ? "expert modus(off)" : "expert modus(on)"),
798
            tr(Expert ? "expert modus(off)" : "expert modus(on)"),
721
	    NULL);
799
            NULL);
722
  }
800
  }
723
}
801
}
724
802
Lines 779-784 Link Here
779
      M->getCropHeight(), M->getCalcAspect());
857
      M->getCropHeight(), M->getCalcAspect());
780
  }
858
  }
781
  AddColItem(new cMenuEditStraItem(tr("CropData"), &NumStatic, 1, CropData));
859
  AddColItem(new cMenuEditStraItem(tr("CropData"), &NumStatic, 1, CropData));
860
861
  // Show what range will be used
862
  if (M->getMarks()) {
863
    asprintf(&RangeData[0], "%s", M->getMarks());
864
    AddColItem(new cMenuEditStraItem(tr("RangeData"), &NumStatic, 1, RangeData));
865
  }
782
  
866
  
783
867
784
  // Bitrate Video
868
  // Bitrate Video
Lines 830-836 Link Here
830
    case 1: { //ScaleType auto
914
    case 1: { //ScaleType auto
831
      asprintf(&ScaleData[0], "%i:%i(Asp: %1.2f Bpp: %1.3f)", M->getScaleWidth(), M->getScaleHeight(), (double)M->getScaleWidth() / (double)M->getScaleHeight(), M->getResBpp());
915
      asprintf(&ScaleData[0], "%i:%i(Asp: %1.2f Bpp: %1.3f)", M->getScaleWidth(), M->getScaleHeight(), (double)M->getScaleWidth() / (double)M->getScaleHeight(), M->getResBpp());
832
      AddColItem(new cMenuEditStraItem(tr("ScaleData"), &NumStatic, 1,
916
      AddColItem(new cMenuEditStraItem(tr("ScaleData"), &NumStatic, 1,
833
	ScaleData));
917
        ScaleData));
834
      Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &MovOSD.Bpp, 1, 99));
918
      Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &MovOSD.Bpp, 1, 99));
835
      break;
919
      break;
836
    }
920
    }
Lines 856-863 Link Here
856
    AddColItem(new cOsdItem(tr("------ expert settings: ------")));
940
    AddColItem(new cOsdItem(tr("------ expert settings: ------")));
857
    if (MovOSD.CropWidth != -1 && MovOSD.CropHeight != -1) {
941
    if (MovOSD.CropWidth != -1 && MovOSD.CropHeight != -1) {
858
      AddColItem(new cOsdItem(tr("- adjust crop values:")));
942
      AddColItem(new cOsdItem(tr("- adjust crop values:")));
859
      Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 0, M->getWidth()));
943
      Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 8, M->getWidth()));
860
      Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 0, M->getHeight()));
944
      Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 8, M->getHeight()));
945
      // values are really checked and limited with cMovie class
946
      // and depend on CropWidth/Height and Width/Height for the following parameters
947
      Add(new cMenuEditIntItem(tr("CropPosX"), &MovOSD.CropPosX, -1, M->getWidth()));
948
      Add(new cMenuEditIntItem(tr("CropPosY"), &MovOSD.CropPosY, -1, M->getHeight()));
861
    }
949
    }
862
      asprintf(&s, tr("- postprocessing Filters(%s):"), M->getPPValues() ? M->getPPValues() : "off");
950
      asprintf(&s, tr("- postprocessing Filters(%s):"), M->getPPValues() ? M->getPPValues() : "off");
863
      AddColItem(new cOsdItem(s));
951
      AddColItem(new cOsdItem(s));
Lines 877-895 Link Here
877
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
965
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
878
      CropWidthsave  = M->getCropWidth();
966
      CropWidthsave  = M->getCropWidth();
879
      CropHeightsave = M->getCropHeight();
967
      CropHeightsave = M->getCropHeight();
968
      CropPosXsave  = M->getCropPosX();
969
      CropPosYsave = M->getCropPosY();
880
    }
970
    }
881
    M->setNumTemplate(MovOSD.Template);
971
    M->setNumTemplate(MovOSD.Template);
882
    // restore old crop values
972
    // restore old crop values
883
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
973
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
884
      M->setCropValues(CropWidthsave, CropHeightsave);
974
      M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave);
885
    }
975
    }
886
    M->saveMovieData();
976
    M->saveMovieData();
887
    Set();
977
    Set();
888
978
889
#ifdef VDRRIP_DVD
979
#ifdef VDRRIP_DVD
890
  } else if (M->isDVD() && MovOSD.Title != MovOSDsave.Title && MovOSD.Title > 0) {
980
  } else if (M->isDVD() && MovOSD.Title != MovOSDsave.Title && MovOSD.Title > 0) {
981
#if VDRVERSNUM >= 10307
982
    Skins.Message(mtStatus, tr("reading audio-data from dvd..."));
983
    Skins.Flush();
984
#else
891
    Interface->Status(tr("reading audio-data from dvd..."));
985
    Interface->Status(tr("reading audio-data from dvd..."));
892
    Interface->Flush();
986
    Interface->Flush();
987
#endif
893
    M->setDVDTitle(MovOSD.Title, true);
988
    M->setDVDTitle(MovOSD.Title, true);
894
    M->saveMovieData();
989
    M->saveMovieData();
895
    Set();
990
    Set();
Lines 914-920 Link Here
914
1009
915
  } else if (MovOSD.Container != MovOSDsave.Container) {
1010
  } else if (MovOSD.Container != MovOSDsave.Container) {
916
    if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 &&
1011
    if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 &&
917
	strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) {
1012
        strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) {
918
      // avi couldn't contain ogg-vorbis audio
1013
      // avi couldn't contain ogg-vorbis audio
919
      M->setContainer(MovOSDsave.Container);
1014
      M->setContainer(MovOSDsave.Container);
920
    } else {
1015
    } else {
Lines 930-936 Link Here
930
1025
931
  } else if (MovOSD.ACodec != MovOSDsave.ACodec) {
1026
  } else if (MovOSD.ACodec != MovOSDsave.ACodec) {
932
    if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 &&
1027
    if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 &&
933
	strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) {
1028
        strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) {
934
      // avi couldn't contain ogg-vorbis audio
1029
      // avi couldn't contain ogg-vorbis audio
935
      M->setCodecs(MovOSD.VCodec, MovOSDsave.ACodec);
1030
      M->setCodecs(MovOSD.VCodec, MovOSDsave.ACodec);
936
    } else {
1031
    } else {
Lines 949-958 Link Here
949
    if (MovOSDsave.ScaleType == 1 || MovOSDsave.ScaleType == 3) {
1044
    if (MovOSDsave.ScaleType == 1 || MovOSDsave.ScaleType == 3) {
950
      CropWidthsave  = M->getCropWidth();
1045
      CropWidthsave  = M->getCropWidth();
951
      CropHeightsave = M->getCropHeight();
1046
      CropHeightsave = M->getCropHeight();
1047
      CropPosXsave  = M->getCropPosX();
1048
      CropPosYsave = M->getCropPosY();
952
      M->setScaleType(MovOSD.ScaleType);
1049
      M->setScaleType(MovOSD.ScaleType);
953
    } else {
1050
    } else {
954
      M->setScaleType(MovOSD.ScaleType);
1051
      M->setScaleType(MovOSD.ScaleType);
955
      M->setCropValues(CropWidthsave, CropHeightsave);
1052
      M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave);
956
    }
1053
    }
957
    M->saveMovieData();
1054
    M->saveMovieData();
958
    Set();
1055
    Set();
Lines 971-988 Link Here
971
    Set();
1068
    Set();
972
1069
973
  } else if (MovOSD.CropWidth != MovOSDsave.CropWidth || MovOSD.CropHeight != MovOSDsave.CropHeight) {
1070
  } else if (MovOSD.CropWidth != MovOSDsave.CropWidth || MovOSD.CropHeight != MovOSDsave.CropHeight) {
974
    if (MovOSD.CropWidth <= MovOSDsave.CropWidth) {
1071
    if (ABS(MovOSD.CropWidth - MovOSDsave.CropWidth)
975
      MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16);
1072
        + ABS(MovOSD.CropHeight - MovOSDsave.CropHeight) == 1) {
976
    } else {MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16) + 16;}
1073
      MovOSD.CropWidth = MovOSDsave.CropWidth + 8*(MovOSD.CropWidth - MovOSDsave.CropWidth);
977
    
1074
      MovOSD.CropHeight = MovOSDsave.CropHeight + 8*(MovOSD.CropHeight - MovOSDsave.CropHeight);
978
    if (MovOSD.CropHeight <= MovOSDsave.CropHeight) {
1075
    }
979
      MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16);
980
    } else {MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16) + 16;} 
981
1076
982
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight);
1077
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight);
983
    M->saveMovieData();
1078
    M->saveMovieData();
984
    Set();
1079
    Set();
985
1080
1081
  } else if (MovOSD.CropPosX != MovOSDsave.CropPosX || MovOSD.CropPosY != MovOSDsave.CropPosY) {
1082
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight, MovOSD.CropPosX, MovOSD.CropPosY);
1083
    M->saveMovieData();
1084
    Set();
1085
986
  } else if (MovOSD.PPDeinterlace != MovOSDsave.PPDeinterlace || MovOSD.PPDeblock != MovOSDsave.PPDeblock) {
1086
  } else if (MovOSD.PPDeinterlace != MovOSDsave.PPDeinterlace || MovOSD.PPDeblock != MovOSDsave.PPDeblock) {
987
    if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 0) M->setPPValues(NULL);
1087
    if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 0) M->setPPValues(NULL);
988
    else if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 1) M->setPPValues("hb/vb/dr/al");
1088
    else if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 1) M->setPPValues("hb/vb/dr/al");
Lines 1033-1044 Link Here
1033
      }
1133
      }
1034
1134
1035
      case kRed: {
1135
      case kRed: {
1036
	int p;
1136
        int p;
1037
	Interface->Confirm(tr("<ok> for preview-mode")) ? p = 1 : p = 0;
1137
        Interface->Confirm(tr("<ok> for preview-mode")) ? p = 1 : p = 0;
1038
        if (Interface->Confirm(tr("add movie to encoding queue ?"))) {
1138
        if (Interface->Confirm(tr("add movie to encoding queue ?"))) {
1039
	  cQueue *Q;
1139
          cQueue *Q;
1040
          struct QueueData *q;
1140
          struct QueueData *q;
1041
	  Q = new cQueue;
1141
          Q = new cQueue;
1042
          q = (struct QueueData*)malloc(sizeof(struct QueueData));
1142
          q = (struct QueueData*)malloc(sizeof(struct QueueData));
1043
1143
1044
          q->Dir          = M->getDir();
1144
          q->Dir          = M->getDir();
Lines 1062-1124 Link Here
1062
          q->Rename       = VdrripSetup.Rename;
1162
          q->Rename       = VdrripSetup.Rename;
1063
          q->Container    = M->C->getContainer(M->getContainer());
1163
          q->Container    = M->C->getContainer(M->getContainer());
1064
          q->Preview      = p;
1164
          q->Preview      = p;
1165
          q->PreviewFileNum   = M->getPreviewFileNum();
1166
          q->PreviewStartByte = M->getPreviewStartByte();
1167
          q->PreviewFrames    = M->getPreviewFrames();
1168
          q->FileNum          = M->getFileNum();
1169
          q->StartByte        = M->getStartByte();
1170
          q->Frames           = M->getFrames();
1065
1171
1066
          if(Q->New(q)) {
1172
          if(Q->New(q)) {
1067
            FREE(q);
1173
            FREE(q);
1068
            DELETE(Q);
1174
            DELETE(Q);
1069
            return osBack;
1175
            return osBack;
1070
          } else {Interface->Error(tr("the queuefile is locked by the queuehandler !"));}
1176
          } else {
1177
#if VDRVERSNUM >= 10307
1178
            Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !"));
1179
#else
1180
            Interface->Error(tr("the queuefile is locked by the queuehandler !"));
1181
#endif
1182
          }
1071
1183
1072
          FREE(q);
1184
          FREE(q);
1073
          DELETE(Q);
1185
          DELETE(Q);
1074
1186
1075
	  Set();
1187
          Set();
1076
        }
1188
        }
1077
        break;
1189
        break;
1078
      }
1190
      }
1079
1191
1080
      case kGreen: {
1192
      case kGreen: {
1081
        if (MovOSD.ScaleType == 1 | MovOSD.ScaleType == 3) {
1193
        if (MovOSD.ScaleType == 1 | MovOSD.ScaleType == 3) {
1082
	  if (CropReset) {
1194
          if (CropReset) {
1083
	    if (Interface->Confirm(tr("reset black movie boarders ?"))) {
1195
            if (Interface->Confirm(tr("reset black movie boarders ?"))) {
1084
	        CropReset = false;
1196
                CropReset = false;
1085
		M->initCropValues();
1197
                M->initCropValues();
1086
		M->setScale();
1198
                M->setScale();
1087
		M->saveMovieData();
1199
                M->saveMovieData();
1088
	    }
1200
            }
1089
	  } else {
1201
          } else {
1090
	    if (Interface->Confirm(tr("crop black movie boarders ?"))) {
1202
            if (Interface->Confirm(tr("crop black movie boarders ?"))) {
1091
	      CropReset = true;
1203
              CropReset = true;
1204
#if VDRVERSNUM >= 10307
1205
              Skins.Message(mtStatus, tr("search for black movie boarders"));
1206
              Skins.Flush();
1207
#else
1092
              Interface->Status(tr("search for black movie boarders"));
1208
              Interface->Status(tr("search for black movie boarders"));
1093
	      Interface->Flush();
1209
              Interface->Flush();
1210
#endif
1094
              if (! M->setCropValues()) {
1211
              if (! M->setCropValues()) {
1095
		CropReset = false;
1212
                CropReset = false;
1096
		Interface->Error(tr("couldn't detect black movie boarders !"));
1213
#if VDRVERSNUM >= 10307
1097
	      }
1214
                Skins.Message(mtError, tr("couldn't detect black movie boarders !"));
1098
	      M->saveMovieData();
1215
#else
1216
                Interface->Error(tr("couldn't detect black movie boarders !"));
1217
#endif
1218
              }
1219
              M->saveMovieData();
1099
            }
1220
            }
1100
	  }
1221
          }
1101
	  Set();
1222
          Set();
1102
        }
1223
        }
1103
        break;
1224
        break;
1104
      }
1225
      }
1105
1226
1106
      case kYellow: {
1227
      case kYellow: {
1107
       Expert ? Expert = false : Expert = true;
1228
       Expert ? Expert = false : Expert = true;
1108
	Set();
1229
        Set();
1109
        break;
1230
        break;
1110
      }
1231
      }
1111
1232
1112
      case kOk: {
1233
      case kOk: {
1113
	const char *l = Get(Current())->Text();
1234
        const char *l = Get(Current())->Text();
1114
	if (strstr(l, tr("Audio-Str."))) {
1235
        if (strstr(l, tr("Audio-Str."))) {
1115
	  AddSubMenu(new cMenuVdrripMovieAudio(M));
1236
          AddSubMenu(new cMenuVdrripMovieAudio(M));
1116
#ifdef VDRRIP_DVD
1237
#ifdef VDRRIP_DVD
1117
	} else if (strstr(l, tr("Title*"))) {
1238
        } else if (strstr(l, tr("Title*"))) {
1118
	  AddSubMenu(new cMenuVdrripMovieTitles(M));
1239
          AddSubMenu(new cMenuVdrripMovieTitles(M));
1119
#endif //VDRRIP_DVD
1240
#endif //VDRRIP_DVD
1120
	}
1241
        }
1121
	break;
1242
        break;
1122
      }
1243
      }
1123
1244
1124
      default: 
1245
      default: 
Lines 1133-1143 Link Here
1133
}
1254
}
1134
1255
1135
void cMenuVdrripMovie::AddColItem(cOsdItem *i) {
1256
void cMenuVdrripMovie::AddColItem(cOsdItem *i) {
1257
#if VDRVERSNUM < 10307
1136
#ifdef clrScrolLine
1258
#ifdef clrScrolLine
1137
   i->SetColor(clrScrolLine, clrBackground);
1259
   i->SetColor(clrScrolLine, clrBackground);
1138
#else
1260
#else
1139
   i->SetColor(clrCyan, clrBackground);
1261
   i->SetColor(clrCyan, clrBackground);
1140
#endif
1262
#endif
1263
#endif
1141
1264
1142
  Add(i);
1265
  Add(i);
1143
}
1266
}
Lines 1163-1170 Link Here
1163
  eOSState state = cOsdMenu::ProcessKey(Key);
1286
  eOSState state = cOsdMenu::ProcessKey(Key);
1164
1287
1165
  if (Key == kOk) {
1288
  if (Key == kOk) {
1289
#if VDRVERSNUM >= 10307
1290
    Skins.Message(mtStatus, tr("reading audio-data from dvd..."));
1291
    Skins.Flush();
1292
#else
1166
    Interface->Status(tr("reading audio-data from dvd..."));
1293
    Interface->Status(tr("reading audio-data from dvd..."));
1167
    Interface->Flush();
1294
    Interface->Flush();
1295
#endif
1168
    M->setDVDTitle(Current() + 1, true);
1296
    M->setDVDTitle(Current() + 1, true);
1169
    M->saveMovieData();
1297
    M->saveMovieData();
1170
    return osBack;
1298
    return osBack;
Lines 1212-1217 Link Here
1212
  MinScaleWidth    = 480;
1340
  MinScaleWidth    = 480;
1213
  CropMode         = 0;
1341
  CropMode         = 0;
1214
  CropLength       = 5;
1342
  CropLength       = 5;
1343
  PreviewLength    = 60;
1215
  Rename           = 0;
1344
  Rename           = 0;
1216
  OggVorbis        = 0;
1345
  OggVorbis        = 0;
1217
  AC3              = 0;
1346
  AC3              = 0;
Lines 1225-1230 Link Here
1225
  else if (!strcasecmp(Name, "MinScaleWidth")) MinScaleWidth = atoi(Value);
1354
  else if (!strcasecmp(Name, "MinScaleWidth")) MinScaleWidth = atoi(Value);
1226
  else if (!strcasecmp(Name, "CropMode"))      CropMode      = atoi(Value);
1355
  else if (!strcasecmp(Name, "CropMode"))      CropMode      = atoi(Value);
1227
  else if (!strcasecmp(Name, "CropLength"))    CropLength    = atoi(Value);
1356
  else if (!strcasecmp(Name, "CropLength"))    CropLength    = atoi(Value);
1357
  else if (!strcasecmp(Name, "PreviewLength")) PreviewLength = atoi(Value);
1228
  else if (!strcasecmp(Name, "Rename"))        Rename        = atoi(Value);
1358
  else if (!strcasecmp(Name, "Rename"))        Rename        = atoi(Value);
1229
  else if (!strcasecmp(Name, "OggVorbis"))     OggVorbis     = atoi(Value);
1359
  else if (!strcasecmp(Name, "OggVorbis"))     OggVorbis     = atoi(Value);
1230
  else if (!strcasecmp(Name, "AC3"))           AC3           = atoi(Value);
1360
  else if (!strcasecmp(Name, "AC3"))           AC3           = atoi(Value);
Lines 1246-1251 Link Here
1246
  Add(new cMenuEditIntItem(tr("MinScaleWidth"), &data.MinScaleWidth, 1, 9999));
1376
  Add(new cMenuEditIntItem(tr("MinScaleWidth"), &data.MinScaleWidth, 1, 9999));
1247
  Add(new cMenuEditStraItem(tr("Crop Mode"), &data.CropMode, 2, CropModes));
1377
  Add(new cMenuEditStraItem(tr("Crop Mode"), &data.CropMode, 2, CropModes));
1248
  Add(new cMenuEditIntItem(tr("Crop DetectLength (s)"), &data.CropLength, 1, 999));
1378
  Add(new cMenuEditIntItem(tr("Crop DetectLength (s)"), &data.CropLength, 1, 999));
1379
  Add(new cMenuEditIntItem(tr("PreviewLength (s)"), &data.PreviewLength, 1, 9999));
1249
  Add(new cMenuEditBoolItem(tr("Rename movie after encoding"), &data.Rename, tr("no"), tr("yes")));
1380
  Add(new cMenuEditBoolItem(tr("Rename movie after encoding"), &data.Rename, tr("no"), tr("yes")));
1250
  Add(new cMenuEditBoolItem(tr("Ogg-Vorbis support"), &data.OggVorbis, tr("no"), tr("yes")));
1381
  Add(new cMenuEditBoolItem(tr("Ogg-Vorbis support"), &data.OggVorbis, tr("no"), tr("yes")));
1251
  Add(new cMenuEditBoolItem(tr("AC3 support (MPlayer-patch inst.)"), &data.AC3, tr("no"), tr("yes")));
1382
  Add(new cMenuEditBoolItem(tr("AC3 support (MPlayer-patch inst.)"), &data.AC3, tr("no"), tr("yes")));
Lines 1267-1272 Link Here
1267
  SetupStore("MinScaleWidth", VdrripSetup.MinScaleWidth);
1398
  SetupStore("MinScaleWidth", VdrripSetup.MinScaleWidth);
1268
  SetupStore("CropMode",      VdrripSetup.CropMode);
1399
  SetupStore("CropMode",      VdrripSetup.CropMode);
1269
  SetupStore("CropLength",    VdrripSetup.CropLength);
1400
  SetupStore("CropLength",    VdrripSetup.CropLength);
1401
  SetupStore("PreviewLength", VdrripSetup.PreviewLength);
1270
  SetupStore("Rename",        VdrripSetup.Rename);
1402
  SetupStore("Rename",        VdrripSetup.Rename);
1271
  SetupStore("OggVorbis",     VdrripSetup.OggVorbis);
1403
  SetupStore("OggVorbis",     VdrripSetup.OggVorbis);
1272
  SetupStore("AC3",           VdrripSetup.AC3);
1404
  SetupStore("AC3",           VdrripSetup.AC3);
(-)vdrrip-0.3.0/menu-vdrrip.h (-1 / +16 lines)
Lines 7-12 Link Here
7
7
8
#include <vdr/osd.h>
8
#include <vdr/osd.h>
9
#include <vdr/menuitems.h>
9
#include <vdr/menuitems.h>
10
#if VDRVERSNUM >= 10307
11
#include <vdr/menu.h>
12
#include <vdr/skins.h>
13
#endif
10
14
11
#include "movie.h"
15
#include "movie.h"
12
#include "vdrriprecordings.h"
16
#include "vdrriprecordings.h"
Lines 35-40 Link Here
35
  //expert menu:
39
  //expert menu:
36
  int CropWidth;
40
  int CropWidth;
37
  int CropHeight;
41
  int CropHeight;
42
  int CropPosX;
43
  int CropPosY;
38
  int PPDeinterlace;
44
  int PPDeinterlace;
39
  int PPDeblock;
45
  int PPDeblock;
40
  int Bpp;
46
  int Bpp;
Lines 51-57 Link Here
51
57
52
#ifdef VDRRIP_DVD
58
#ifdef VDRRIP_DVD
53
59
54
class cMenuVdrripWarning : public cOsdMenu {
60
class cMenuVdrripWarning
61
#if VDRVERSNUM >= 10307
62
  : public cMenuText {
63
#else
64
  : public cOsdMenu {
65
#endif
55
private:
66
private:
56
  bool hadsubmenu;
67
  bool hadsubmenu;
57
68
Lines 140-151 Link Here
140
  char *FileSize[1];
151
  char *FileSize[1];
141
  char *MovieData[1];
152
  char *MovieData[1];
142
  char *CropData[1];
153
  char *CropData[1];
154
  char *RangeData[1];
143
  char *ScaleData[1];
155
  char *ScaleData[1];
144
156
145
  bool OSDupdate, Crop, CropReset, Expert;
157
  bool OSDupdate, Crop, CropReset, Expert;
146
158
147
  int CropWidthsave;
159
  int CropWidthsave;
148
  int CropHeightsave;
160
  int CropHeightsave;
161
  int CropPosXsave;
162
  int CropPosYsave;
149
163
150
  int NumStatic;
164
  int NumStatic;
151
165
Lines 182-187 Link Here
182
  int MinScaleWidth;
196
  int MinScaleWidth;
183
  int CropMode;
197
  int CropMode;
184
  int CropLength;
198
  int CropLength;
199
  int PreviewLength;
185
  int Rename;
200
  int Rename;
186
  int OggVorbis;
201
  int OggVorbis;
187
  int AC3;
202
  int AC3;
(-)vdrrip-0.3.0/movie.c (-132 / +265 lines)
Lines 6-17 Link Here
6
#include <stdlib.h>
6
#include <stdlib.h>
7
#include <string.h>
7
#include <string.h>
8
#include <math.h>
8
#include <math.h>
9
#include <sys/types.h>
10
#include <sys/stat.h>
11
#include <unistd.h>
9
12
10
#ifdef VDRRIP_DVD
13
#ifdef VDRRIP_DVD
11
  #include <dvdnav/ifo_read.h>
14
  #include <dvdnav/ifo_read.h>
12
#endif //VDRRIP_DVD
15
#endif //VDRRIP_DVD
13
16
14
#include <vdr/plugin.h>
17
#include <vdr/plugin.h>
18
#include <vdr/recording.h>
15
19
16
#include "movie.h"
20
#include "movie.h"
17
#include "menu-vdrrip.h"
21
#include "menu-vdrrip.h"
Lines 21-30 Link Here
21
25
22
#define SAVEFILE "save.vdrrip"
26
#define SAVEFILE "save.vdrrip"
23
27
24
#define IDENTCMD "%s \'%s\'%s -identify -frames 0 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
28
#define DVDIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
25
#define CROPCMD "%s \'%s\'%s -vo null -ao null -really-quiet -ss %i -frames %i -vop cropdetect 2>/dev/null | grep \"crop=\" | sed \"s/.*crop\\(.*\\)).*/\\1/\" | sort | uniq -c | sort -r"
29
#define DVDCROP "%s \'%s\'%s -vo null -ao null -quiet -ss %i -frames %i -vf cropdetect 2>/dev/null | sed -ne \'/crop=/ s/.*crop\\(=.*\\)).*/\\1/p\' | sort | uniq -c | sort -nr"
26
#define AUDIOCMD "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
30
#define DVDAUDIO "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
27
#define AUDIOCMDDVD "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
31
32
#define VDRIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
33
#define VDRCROP "%s \'%s\'%s -vo null -ao null -quiet -sb %lld -frames %i -vf cropdetect 2>/dev/null | sed -ne \'/crop=/ s/.*crop\\(=.*\\)).*/\\1/p\' | sort | uniq -c | sort -nr"
34
#define VDRAUDIO "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
35
28
#define MENCCMD "%s %s help 2>/dev/null"
36
#define MENCCMD "%s %s help 2>/dev/null"
29
37
30
// --- cMovie ------------------------------------------------------------
38
// --- cMovie ------------------------------------------------------------
Lines 38-44 Link Here
38
  StrTitles = NULL;
46
  StrTitles = NULL;
39
#endif //VDRRIP_DVD
47
#endif //VDRRIP_DVD
40
48
41
  Dir = OrigName = Name = PPValues = NULL;
49
  Dir = Marks = Name = OrigName = PPValues = NULL;
42
  A = NULL;
50
  A = NULL;
43
  StrAudioData = StrAudioData2 = NULL;
51
  StrAudioData = StrAudioData2 = NULL;
44
52
Lines 75-83 Link Here
75
    Dvd = false;
83
    Dvd = false;
76
84
77
    // detect vdr-data
85
    // detect vdr-data
78
    setLengthVDR();
79
    queryMpValuesVDR();
86
    queryMpValuesVDR();
80
    queryAudioDataVDR();
87
    queryAudioDataVDR();
88
    setLengthVDR();
89
    setMarksVDR();
81
    
90
    
82
    if (! restoreMovieData()) {
91
    if (! restoreMovieData()) {
83
      // set to default template
92
      // set to default template
Lines 167-174 Link Here
167
int cMovie::getFileNumbers() {return FileNumbers;}
176
int cMovie::getFileNumbers() {return FileNumbers;}
168
177
169
void cMovie::setBitrate(int v, int a) {
178
void cMovie::setBitrate(int v, int a) {
170
  // avoid BitrateAudio < 32
179
  // set audio bitrates and avoid BitrateAudio < 32
171
  if (a < 32 && strcmp(C->getACodec(ACodec), "copy") != 0) {a = 32;}
180
  if (ACodec == C->getNumACodec("copy")) { a = A[AudioID].Bitrate; }
181
  else { if (a < 32) {a = 32;} }
172
  BitrateAudio = a;
182
  BitrateAudio = a;
173
183
174
  if (v == -1) {
184
  if (v == -1) {
Lines 182-194 Link Here
182
     
192
     
183
      // avoid BitrateVideo < 150
193
      // avoid BitrateVideo < 150
184
      if (Bitrate <= BitrateAudio + 150) {
194
      if (Bitrate <= BitrateAudio + 150) {
185
	Bitrate = BitrateAudio + 150;
195
        Bitrate = BitrateAudio + 150;
186
        setFileSize(-1, FileNumbers);
196
        setFileSize(-1, FileNumbers);
187
      }
197
      }
188
      
198
      
189
      // avoid BitrateVideo > 99999
199
      // avoid BitrateVideo > 99999
190
      if (Bitrate > BitrateAudio + 99999) {
200
      if (Bitrate > BitrateAudio + 99999) {
191
	Bitrate = BitrateAudio + 99999;
201
        Bitrate = BitrateAudio + 99999;
192
        setFileSize(-1, FileNumbers);
202
        setFileSize(-1, FileNumbers);
193
      }
203
      }
194
204
Lines 259-265 Link Here
259
  ScaleHeight = height;
269
  ScaleHeight = height;
260
}
270
}
261
271
272
void cMovie::setCropValues(int width, int height, int posx, int posy) {
273
  setCropValues(width, height);
274
275
  if (posx > Width - CropWidth) { CropPosX = Width - CropWidth; }
276
  else if (posx < 0) { CropPosX = 0; }
277
  else { CropPosX = posx; }
278
279
  if (posy > Height - CropHeight) { CropPosY = Height - CropHeight; }
280
  else if (posy < 0) { CropPosY = 0; }
281
  else { CropPosY = posy; }
282
}
283
262
void cMovie::setCropValues(int width, int height) {
284
void cMovie::setCropValues(int width, int height) {
285
  CalcAspect = Aspect;
286
263
  CropWidth  = width;
287
  CropWidth  = width;
264
  if (CropWidth > Width) CropWidth = Width;
288
  if (CropWidth > Width) CropWidth = Width;
265
  
289
  
Lines 267-280 Link Here
267
  if (CropHeight > Height) CropHeight = Height;
291
  if (CropHeight > Height) CropHeight = Height;
268
292
269
  if (CropWidth == -1) CropPosX = -1;
293
  if (CropWidth == -1) CropPosX = -1;
270
  else CropPosX = (Width - CropWidth) / 2;
294
  else {
295
    CropPosX = (Width - CropWidth) / 2;
296
    CalcAspect = CropWidth * CalcAspect / Width;
297
  }
271
298
272
  if (CropHeight == -1) {
299
  if (CropHeight == -1) {CropPosY = -1;}
273
    CropPosY = -1;
300
  else {
274
    CalcAspect = Aspect;
275
  } else {
276
    CropPosY = (Height - CropHeight) / 2;
301
    CropPosY = (Height - CropHeight) / 2;
277
    CalcAspect = Height * Aspect / CropHeight;
302
    CalcAspect = Height * CalcAspect / CropHeight;
278
  }
303
  }
279
304
280
  setScale();
305
  setScale();
Lines 285-356 Link Here
285
  char *cmd = NULL, *buf = NULL;
310
  char *cmd = NULL, *buf = NULL;
286
  bool ret = true;
311
  bool ret = true;
287
312
288
  size_t i = 0;
313
  off_t skipbytes = 0;
289
  int l = 0;
314
  int skipseconds = 0;
290
  int l1;
315
  int frames_to_inspect;
291
316
292
  if (Dvd) {asprintf(&cmd, IDENTCMD, MPlayer, Dir, "");
317
  FILE *p = NULL;
293
  } else {asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr");}
294
318
295
  FILE *p = popen(cmd, "r");
319
  if (Dvd) {
296
  if (p) {
320
    asprintf(&cmd, DVDIDENT, MPlayer, Dir, "");
297
    char *s = NULL;
321
298
    s = strcol(strgrep("ID_LENGTH", p), "=", 2);
322
    p = popen(cmd, "r");
299
    if (s) {l = atoi(s);}
323
    if (p) {
300
    FREE(s);
324
      char *s = NULL;
325
      s = strcol(strgrep("ID_LENGTH", p), "=", 2);
326
      if (s) {skipseconds = atoi(s)/2;}
327
      FREE(s);
328
    } else {
329
      dsyslog("[vdrrip] could not open pipe to %s !", cmd);
330
    }
331
    pclose(p);
332
    FREE(cmd);
301
  } else {
333
  } else {
302
    dsyslog("[vdrrip] could not open pipe to %s !", cmd);
334
    asprintf(&cmd, "%s%s", Dir, "/001.vdr"); //lazy and safe strcat
303
  }
335
304
  pclose(p);
336
    /* skip to the middle of 001.vdr - there are cases where -ss option of
305
  FREE(cmd);
337
     * mplayer does not work to seek a vdr file, so use -sb instead
338
     */
339
    struct stat *vdrstat = (struct stat *) malloc(sizeof(struct stat));
340
    if (0 == stat(cmd, vdrstat)) {
341
      skipbytes = (vdrstat->st_size) >> 1; // divide filesize by 2
342
    } else {
343
      dsyslog("[vdrrip] could not stat %s to determine filesize!", cmd);
344
    }
306
345
346
    FREE(vdrstat);
347
    FREE(cmd);
348
  }
307
349
308
  l1 = VdrripSetup.CropLength * (int)Fps;
350
  frames_to_inspect = VdrripSetup.CropLength * (int)Fps;
309
  if (Dvd) {
351
  if (Dvd) {
310
    asprintf(&cmd, CROPCMD, MPlayer, Dir, "", l/2, l1);
352
    asprintf(&cmd, DVDCROP, MPlayer, Dir, "", skipseconds, frames_to_inspect);
311
    isyslog("[vdrrip] detecting crop values in %s", Dir);
353
    isyslog("[vdrrip] detecting crop values in %s", Dir);
312
  } else {
354
  } else {
313
    asprintf(&cmd, CROPCMD, MPlayer, Dir, "/001.vdr", l/2, l1);
355
    asprintf(&cmd, VDRCROP, MPlayer, Dir, "/001.vdr", (long long) skipbytes, frames_to_inspect);
314
    isyslog("[vdrrip] detecting crop values in %s/001.vdr", Dir);
356
    isyslog("[vdrrip] detecting crop values in %s/001.vdr", Dir);
357
    isyslog("[vdrrip] mplayer command used: %s", cmd);
315
  }
358
  }
316
  p = popen(cmd, "r");
359
  p = popen(cmd, "r");
317
  FREE(cmd);
360
  FREE(cmd);
318
361
319
  if (p) {
362
  if (p) {
320
    //  get first line
363
    /* get first line only - shows most occurences of identically detected crop parameters
364
     * within frames_to_inspect starting from skipseconds/skipbytes
365
     */
366
    size_t i;
321
    if (getline(&buf, &i, p) != -1) {
367
    if (getline(&buf, &i, p) != -1) {
322
      char *s = NULL;
368
      char *s = NULL;
323
369
324
      s = strcol(buf, "=", 2);
370
      s = strcol(buf, "=", 2);
325
      CropWidth = roundValue(atoi(strcol(s, ":", 1)), 16);
371
      CropHeight = atoi(strcol(s, ":", 2));
326
      if (CropWidth > Width || CropWidth < 0) {
372
      CropPosY = atoi(strcol(s, ":", 4));
327
	ret = false;
373
      if (CropHeight > Height || CropHeight < 8) {ret = false;}
328
	CropWidth = Width;
374
      if (CropPosY > Height - CropHeight || CropPosY < 0) {ret = false;}
329
      }
375
330
      
376
      // crop width only if desired
331
      CropHeight = roundValue(atoi(strcol(s, ":", 2)), 16);
377
      if (VdrripSetup.CropMode == 1) {
332
      if (CropHeight > Height || CropHeight < 0) {
378
        CropWidth = Width;
333
	ret = false;
379
        CropPosX = 0;
334
	CropHeight = Height;
380
      } else {
381
        CropWidth = atoi(strcol(s, ":", 1));
382
        CropPosX = atoi(strcol(s, ":", 3));
383
        if (CropWidth > Width || CropWidth < 8) {ret = false;}
384
        if (CropPosX > Width - CropWidth || CropPosX < 0) {ret = false;}
335
      }
385
      }
336
386
337
      if (VdrripSetup.CropMode == 1) {CropWidth = Width;} 
387
      // CalcAspect is changed now
338
      CropPosX = (Width - CropWidth) / 2;
388
      if (ret) {
339
      CropPosY = (Height - CropHeight) / 2;
389
        CalcAspect = Height * Aspect / CropHeight;
340
      // CalcAspect is changed now:
390
        setScale();
341
      CalcAspect = Height * Aspect / CropHeight;
391
      }
342
      setScale();
343
392
344
      FREE(s);
393
      FREE(s);
345
      FREE(buf);
394
      FREE(buf);
346
    } else {
347
      ret = false;
348
    }
395
    }
349
396
350
  pclose(p);
397
    pclose(p);
351
  } else ret = false;
398
  }
352
399
353
  if (! ret) initCropValues();
400
  if (!ret) initCropValues();
354
401
355
  return ret;
402
  return ret;
356
}
403
}
Lines 363-368 Link Here
363
  CalcAspect = Aspect;
410
  CalcAspect = Aspect;
364
}
411
}
365
412
413
int cMovie::getPreviewFileNum() { return PreviewFileNum; }
414
int cMovie::getPreviewStartByte() { return PreviewStartByte; }
415
int cMovie::getPreviewFrames() { return PreviewFrames; }
416
int cMovie::getFileNum() { return FileNum; }
417
int cMovie::getStartByte() { return StartByte; }
418
int cMovie::getFrames() { return Frames; }
419
char *cMovie::getMarks() { return Marks; } 
420
366
void cMovie::setCodecs(int v, int a) {
421
void cMovie::setCodecs(int v, int a) {
367
  // validate video codec
422
  // validate video codec
368
  if (v >= 0 && v < C->getNumVCodecs()) {VCodec = v;
423
  if (v >= 0 && v < C->getNumVCodecs()) {VCodec = v;
Lines 374-380 Link Here
374
  // validate audio codec
429
  // validate audio codec
375
  if (a >= 0 && a < C->getNumACodecs()) {
430
  if (a >= 0 && a < C->getNumACodecs()) {
376
    if (strcmp(C->getContainer(Container), "avi") == 0 &&
431
    if (strcmp(C->getContainer(Container), "avi") == 0 &&
377
	strcmp(C->getACodec(a), "ogg-vorbis") == 0) {
432
        strcmp(C->getACodec(a), "ogg-vorbis") == 0) {
378
      dsyslog("[vdrrip] avi couldn't contain ogg-vorbis audio, falling back to copy !");
433
      dsyslog("[vdrrip] avi couldn't contain ogg-vorbis audio, falling back to copy !");
379
      ACodec = C->getNumACodec("copy");
434
      ACodec = C->getNumACodec("copy");
380
    } else {ACodec = a;}
435
    } else {ACodec = a;}
Lines 383-394 Link Here
383
    ACodec = C->getNumACodec("copy");
438
    ACodec = C->getNumACodec("copy");
384
  }
439
  }
385
440
386
  // set audio bitrates
441
  // set bitrates
387
  if (ACodec == C->getNumACodec("copy")) {
442
  setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate));
388
    setBitrate(T->getBitrateVideo(NumTemplate), A[AudioID].Bitrate);
389
  } else {
390
    setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate));
391
  }
392
}
443
}
393
444
394
void cMovie::setBpp(int i) {
445
void cMovie::setBpp(int i) {
Lines 429-435 Link Here
429
int cMovie::getCropPosY() {return CropPosY;}
480
int cMovie::getCropPosY() {return CropPosY;}
430
481
431
double cMovie::getResBpp() {
482
double cMovie::getResBpp() {
432
  return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps;}
483
  return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps;
484
}
433
485
434
double cMovie::getBpp() {return (double)Bpp;}
486
double cMovie::getBpp() {return (double)Bpp;}
435
487
Lines 491-500 Link Here
491
}
543
}
492
544
493
545
546
bool cMovie::getByteOffset(int frameindex, int *filenum, int *byteoff) {
547
  bool ret = false;
548
  uchar tmp = 1;
549
550
  cIndexFile *vdrindex = new cIndexFile(Dir, false);
551
  if (vdrindex->Ok()) {
552
    if (vdrindex->Get(frameindex, &tmp, byteoff)) { ret = true; }
553
  }
554
  *filenum = (int) tmp;
555
556
  return ret;
557
}
558
559
560
void cMovie::setMarksVDR() {
561
  EndFrame = Frames = StartFrame = StartByte = -1;
562
  cMarks *vdrmarks = new cMarks();
563
  vdrmarks->Load(Dir);
564
565
  if (vdrmarks->GetNext(StartByte)) StartFrame = vdrmarks->GetNext(0)->position;
566
  if (vdrmarks->GetNext(StartByte)) EndFrame = vdrmarks->GetNext(StartFrame)->position;
567
  FREE(vdrmarks);
568
    
569
  /* rewritten by this function on success, stays NULLified on failure */
570
  FREE(Marks);
571
  Marks = NULL;
572
573
  /* Start marker was set, start encoding at this position (unless index is corrupt) */
574
  if (StartFrame > -1) {
575
576
    /* If the index is not OK, we cannot determine start position..
577
     * discard the start marker, beginning will be used.. */
578
    if (!getByteOffset(StartFrame, &FileNum, &StartByte)) {
579
      FileNum = 1;
580
      StartFrame = StartByte = -1; /* keep StartFrame only if StartByte was calculated */
581
      isyslog("[vdrrip] can't convert start marker to start byte, index in %s is not ok!", Dir);
582
    }
583
584
    /* End marker was set, stop encoding after Frames frames */
585
    if (EndFrame > -1) {
586
      if (StartFrame > -1) { 
587
        Frames = EndFrame - StartFrame + 1;
588
        asprintf(&Marks, "%s - %s",
589
          (const char*) IndexToHMSF(StartFrame, true),
590
          (const char*) IndexToHMSF(EndFrame, true)
591
        );
592
      }
593
      else {
594
        Frames = EndFrame;
595
        asprintf(&Marks, "0:00:00.00 - %s", (const char*) IndexToHMSF(EndFrame, true));
596
      } 
597
598
      /* Update Length for Bitrate, Filesize computation.. */
599
      Length = (int) (Frames / Fps);
600
    } else {
601
      if (StartFrame > -1) {
602
        /* EOF == (const char*) IndexToHMSF(StartFrame + Length * Fps, true) */
603
        asprintf(&Marks, "%s - EOF", (const char*) IndexToHMSF(StartFrame, true));
604
605
        /* Update Length for Bitrate, Filesize computation.. */
606
        Length -= (int) (StartFrame / Fps);
607
      }
608
    }
609
610
  } /* StartFrame > -1 */
611
612
  if (Marks) { isyslog("[vdrrip] using markers, encoding %s..", Marks); }
613
614
  /* calculate related stuff (preview), make sure setMarksVDR is called to set these.. */
615
  int PreviewStartFrame = (int) ((((Frames>-1) ? (Frames) : (Length*Fps)) - getPreviewFrames()) / 2
616
                            + ((StartFrame>-1) ? (StartFrame) : (0)));
617
  if(!getByteOffset(PreviewStartFrame, &PreviewFileNum, &PreviewStartByte)) {
618
    PreviewFileNum = 1;
619
    PreviewStartByte = -1;
620
  }
621
622
  PreviewFrames = VdrripSetup.PreviewLength;
623
  if (PreviewFrames > Length) { PreviewFrames = Length / 2; }
624
  PreviewFrames = (int) (PreviewFrames * Fps);
625
}
626
627
494
void cMovie::queryMpValuesVDR() {
628
void cMovie::queryMpValuesVDR() {
495
  char *cmd = NULL, *s = NULL;
629
  char *cmd = NULL, *s = NULL;
496
630
497
  asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr");
631
  asprintf(&cmd, VDRIDENT, MPlayer, Dir, "/001.vdr");
498
  FILE *p = popen(cmd, "r");
632
  FILE *p = popen(cmd, "r");
499
  if (p) {
633
  if (p) {
500
    s = strcol(strgrep("ID_VIDEO_WIDTH", p), "=", 2);
634
    s = strcol(strgrep("ID_VIDEO_WIDTH", p), "=", 2);
Lines 515-525 Link Here
515
    } else {Fps = -1;}
649
    } else {Fps = -1;}
516
    FREE(s);
650
    FREE(s);
517
651
518
    s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2);
652
    Aspect = -1;
519
    if (s) {
653
    while(s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2)){
520
      Aspect = atof(s);
654
       Aspect = atof(s);
521
    } else {Aspect = -1;}
655
       if (Aspect != 0) break;
522
656
    }   
657
    if (Aspect == 0) {Aspect = 1.333333;}
523
    CalcAspect = Aspect;
658
    CalcAspect = Aspect;
524
659
525
    pclose(p);
660
    pclose(p);
Lines 538-580 Link Here
538
  bool next = true;
673
  bool next = true;
539
674
540
  while (next) {
675
  while (next) {
541
    asprintf(&cmd, AUDIOCMD, MPlayer, Dir, c);
676
    asprintf(&cmd, VDRAUDIO, MPlayer, Dir, c);
542
    FILE *p = popen(cmd, "r");
677
    FILE *p = popen(cmd, "r");
543
    if (p) {
678
    if (p) {
544
      if (getline(&buf, &i, p) != -1) {
679
      if (getline(&buf, &i, p) != -1) {
545
	if (c == 128) {next = false;}
680
        if (c == 128) {next = false;}
546
	A = (struct AudioData*)realloc(A, (n + 1) * sizeof(struct AudioData));
681
        A = (struct AudioData*)realloc(A, (n + 1) * sizeof(struct AudioData));
547
682
548
	A[n].AudioID = c;
683
        A[n].AudioID = c;
549
	A[n].Lang   = strdup(tr("unknown"));
684
        A[n].Lang   = strdup(tr("unknown"));
550
685
551
	if (c == 128) {A[n].Format = strdup("ac3");
686
        if (c == 128) {A[n].Format = strdup("ac3");
552
	} else {A[n].Format = strdup("mp2");}
687
        } else {A[n].Format = strdup("mp2");}
553
688
554
	char *s = NULL;
689
        char *s = NULL;
555
        s = strcol(buf, " ", 2);
690
        s = strcol(buf, " ", 2);
556
	if (s) {A[n].Freq = atoi(s);
691
        if (s) {A[n].Freq = atoi(s);
557
	} else {A[n].Freq = 0;}
692
        } else {A[n].Freq = 0;}
558
	FREE(s);
693
        FREE(s);
559
694
560
        s = strcol(buf, " ", 4);
695
        s = strcol(buf, " ", 4);
561
	if (s) {A[n].Chan = atoi(s);
696
        if (s) {A[n].Chan = atoi(s);
562
	} else {A[n].Chan = 0;}
697
        } else {A[n].Chan = 0;}
563
	FREE(s);
698
        FREE(s);
564
699
565
        s = strcol(buf, " ", 11);
700
        s = strcol(buf, " ", 11);
566
	if (s) {
701
        if (s) {
567
	  A[n].Bitrate = atoi(s + sizeof(char));
702
          A[n].Bitrate = atoi(s + sizeof(char));
568
	} else {A[n].Bitrate = 192;}
703
        } else {A[n].Bitrate = 192;}
569
        FREE(s);
704
        FREE(s);
570
	
705
        
571
	// isyslog("[vdrrip] Audio-ID %i found: lang %s, format %s, %i kbit, %i Hz, %i ch", A[n].AudioID, A[n].Lang, A[n].Format, A[n].Bitrate, A[n].Freq, A[n].Chan);
706
        // isyslog("[vdrrip] Audio-ID %i found: lang %s, format %s, %i kbit, %i Hz, %i ch", A[n].AudioID, A[n].Lang, A[n].Format, A[n].Bitrate, A[n].Freq, A[n].Chan);
572
        n++;
707
        n++;
573
	c++;
708
        c++;
574
      } else {
709
      } else {
575
	// nothing found:
710
        // nothing found:
576
	if (c < 128 && VdrripSetup.AC3 == 1) {c = 128;
711
        if (c < 128 && VdrripSetup.AC3 == 1) {c = 128;
577
	} else {next = false;}
712
        } else {next = false;}
578
      }
713
      }
579
    pclose(p);
714
    pclose(p);
580
    } else {dsyslog("[vdrrip] could not open pipe to %s !", cmd);}
715
    } else {dsyslog("[vdrrip] could not open pipe to %s !", cmd);}
Lines 661-672 Link Here
661
  FILE *f = fopen(file,"r");
796
  FILE *f = fopen(file,"r");
662
  if (f) {
797
  if (f) {
663
    if (getline(&buf, &i, f) != -1) {
798
    if (getline(&buf, &i, f) != -1) {
799
      fclose(f);
800
664
      Name          = strcol(buf, ";",  1);
801
      Name          = strcol(buf, ";",  1);
665
      FileSize      = atoi(strcol(buf, ";",  2));
802
      FileSize      = atoi(strcol(buf, ";",  2));
666
      FileNumbers   = atoi(strcol(buf, ";",  3));
803
      FileNumbers   = atoi(strcol(buf, ";",  3));
667
      Bitrate       = atoi( strcol(buf, ";", 4));
668
      vcodec        = strcol(buf, ";",  5);
804
      vcodec        = strcol(buf, ";",  5);
669
      BitrateVideo  = atoi(strcol(buf, ";",  6));
670
      CropWidth     = atoi(strcol(buf, ";",  7));
805
      CropWidth     = atoi(strcol(buf, ";",  7));
671
      CropHeight    = atoi(strcol(buf, ";",  8));
806
      CropHeight    = atoi(strcol(buf, ";",  8));
672
      CropPosX      = atoi(strcol(buf, ";",  9));
807
      CropPosX      = atoi(strcol(buf, ";",  9));
Lines 676-682 Link Here
676
      ScaleHeight   = atoi(strcol(buf, ";", 13));
811
      ScaleHeight   = atoi(strcol(buf, ";", 13));
677
      Bpp           = atoi(strcol(buf, ";", 14));
812
      Bpp           = atoi(strcol(buf, ";", 14));
678
      acodec        = strcol(buf, ";", 15);
813
      acodec        = strcol(buf, ";", 15);
679
      BitrateAudio  = atoi(strcol(buf, ";", 16));
680
      AudioID       = atoi(strcol(buf, ";", 17));
814
      AudioID       = atoi(strcol(buf, ";", 17));
681
      PPValues      = strcol(buf, ";", 18);
815
      PPValues      = strcol(buf, ";", 18);
682
      if (strcmp(PPValues, "(null)") == 0) PPValues = NULL;
816
      if (strcmp(PPValues, "(null)") == 0) PPValues = NULL;
Lines 689-706 Link Here
689
      if (Dvd) Title = atoi(strcol(buf, ";", 21));
823
      if (Dvd) Title = atoi(strcol(buf, ";", 21));
690
#endif //VDRRIP_DVD
824
#endif //VDRRIP_DVD
691
825
692
      FREE(buf);
693
694
      fclose(f);
695
      isyslog("[vdrrip] restored data from file %s !", file);
696
697
      // validate some values:
826
      // validate some values:
698
      if (! Dvd) setCropValues(CropWidth, CropHeight);
827
      if (! Dvd) setCropValues(CropWidth, CropHeight, CropPosX, CropPosY);
699
828
700
      NumTemplate = T->getNumTemplate(tname);
829
      NumTemplate = T->getNumTemplate(tname);
701
      if (NumTemplate == -1) {
830
      if (NumTemplate == -1) {
702
        dsyslog("[vdrrip] %s is not a valid template, falling back to default !", tname);
831
        dsyslog("[vdrrip] %s is not a valid template, falling back to default !", tname);
703
	NumTemplate = T->getNumTemplate(TDEFAULT);
832
        NumTemplate = T->getNumTemplate(TDEFAULT);
704
      }
833
      }
705
      FREE(tname);
834
      FREE(tname);
706
835
Lines 716-722 Link Here
716
      FREE(acodec);
845
      FREE(acodec);
717
846
718
      setAudioID(AudioID);
847
      setAudioID(AudioID);
848
      setBitrate(atoi(strcol(buf, ";", 6)), atoi(strcol(buf, ";", 16)));
849
      setMarksVDR();
719
850
851
      isyslog("[vdrrip] restored data from file %s !", file);
852
      FREE(buf);
720
    } else {
853
    } else {
721
      dsyslog("[vdrrip] could not read data from file %s !", file);
854
      dsyslog("[vdrrip] could not read data from file %s !", file);
722
      FREE(file);
855
      FREE(file);
Lines 747-759 Link Here
747
    if (! fseek(f, 32808, SEEK_SET )) {
880
    if (! fseek(f, 32808, SEEK_SET )) {
748
      i = fread(name, 1, 32, f);
881
      i = fread(name, 1, 32, f);
749
      if (i == 32) {
882
      if (i == 32) {
750
	name[32] = '\0';
883
        name[32] = '\0';
751
        while(i-- > 2) {if (name[i] == ' ') name[i] = '\0';}
884
        while(i-- > 2) {if (name[i] == ' ') name[i] = '\0';}
752
        Name = strdup(name);
885
        Name = strdup(name);
753
	OrigName = strdup(name);
886
        OrigName = strdup(name);
754
      } else {
887
      } else {
755
	dsyslog("[vdrrip] Couldn't read enough bytes for title !");
888
        dsyslog("[vdrrip] Couldn't read enough bytes for title !");
756
	Name = strdup(tr("unknown"));
889
        Name = strdup(tr("unknown"));
757
      }
890
      }
758
    } else {
891
    } else {
759
      dsyslog("[vdrrip] Couldn't seek in %s for title", DVD);
892
      dsyslog("[vdrrip] Couldn't seek in %s for title", DVD);
Lines 828-850 Link Here
828
961
829
        if (ifo[numifo]->vtsi_mat) {
962
        if (ifo[numifo]->vtsi_mat) {
830
          vtsi_mat     = ifo[numifo]->vtsi_mat;
963
          vtsi_mat     = ifo[numifo]->vtsi_mat;
831
	  vts_pgcit    = ifo[numifo]->vts_pgcit;
964
          vts_pgcit    = ifo[numifo]->vts_pgcit;
832
	  video_attr   = &vtsi_mat->vts_video_attr;
965
          video_attr   = &vtsi_mat->vts_video_attr;
833
	  vts_ttn      = ifo_zero->tt_srpt->title[i].vts_ttn;
966
          vts_ttn      = ifo_zero->tt_srpt->title[i].vts_ttn;
834
	  vmgi_mat     = ifo_zero->vmgi_mat;
967
          vmgi_mat     = ifo_zero->vmgi_mat;
835
	  pgc          = vts_pgcit->pgci_srp[ifo[numifo]->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc;
968
          pgc          = vts_pgcit->pgci_srp[ifo[numifo]->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc;
836
	  dt           = &pgc->playback_time;
969
          dt           = &pgc->playback_time;
837
	  
970
          
838
          // read the movie-data of the title into the struc DVDData:
971
          // read the movie-data of the title into the struc DVDData:
839
	  D[i].Length  = (((dt->hour &   0xf0) >> 3) * 5 + (dt->hour   & 0x0f)) * 3600;
972
          D[i].Length  = (((dt->hour &   0xf0) >> 3) * 5 + (dt->hour   & 0x0f)) * 3600;
840
	  D[i].Length += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60;
973
          D[i].Length += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60;
841
	  D[i].Length += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f));
974
          D[i].Length += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f));
842
	  if (D[i].Length == 0) {D[i].Length = -1;}
975
          if (D[i].Length == 0) {D[i].Length = -1;}
843
976
844
	  D[i].Width    = width[video_attr->picture_size];
977
          D[i].Width    = width[video_attr->picture_size];
845
	  D[i].Height   = height[video_attr->video_format];
978
          D[i].Height   = height[video_attr->video_format];
846
	  D[i].Aspect   = aspect[video_attr->display_aspect_ratio];
979
          D[i].Aspect   = aspect[video_attr->display_aspect_ratio];
847
	  D[i].Fps      = fps[(pgc->playback_time.frame_u & 0xc0) >> 6];
980
          D[i].Fps      = fps[(pgc->playback_time.frame_u & 0xc0) >> 6];
848
981
849
          D[i].NumAudio = vtsi_mat->nr_of_vts_audio_streams;
982
          D[i].NumAudio = vtsi_mat->nr_of_vts_audio_streams;
850
          // reserve memory for DVDAudioData
983
          // reserve memory for DVDAudioData
Lines 856-879 Link Here
856
            asprintf(&D[i].A[i1].Lang, "%c%c", audio_attr->lang_code >> 8, audio_attr -> lang_code & 0xff);
989
            asprintf(&D[i].A[i1].Lang, "%c%c", audio_attr->lang_code >> 8, audio_attr -> lang_code & 0xff);
857
            D[i].A[i1].Format = strdup(audio_format[audio_attr->audio_format]);
990
            D[i].A[i1].Format = strdup(audio_format[audio_attr->audio_format]);
858
            D[i].A[i1].Freq   = atoi(sample_freq[audio_attr->sample_frequency]);
991
            D[i].A[i1].Freq   = atoi(sample_freq[audio_attr->sample_frequency]);
859
	    D[i].A[i1].Chan   = audio_attr->channels+1;
992
            D[i].A[i1].Chan   = audio_attr->channels+1;
860
	    D[i].A[i1].AudioID = 128 + i1;
993
            D[i].A[i1].AudioID = 128 + i1;
861
	    D[i].A[i1].Bitrate = -1;
994
            D[i].A[i1].Bitrate = -1;
862
          }
995
          }
863
	    
996
            
864
          // save number of the longest Title
997
          // save number of the longest Title
865
          if (D[i].Length > l) {
998
          if (D[i].Length > l) {
866
            l = D[i].Length;
999
            l = D[i].Length;
867
            Title  = i + 1;
1000
            Title  = i + 1;
868
	    LongestTitle = Title;
1001
            LongestTitle = Title;
869
          }
1002
          }
870
	}
1003
        }
871
      }
1004
      }
872
1005
873
      // close ifos
1006
      // close ifos
874
      ifoClose(ifo_zero);
1007
      ifoClose(ifo_zero);
875
      for (i = 1; i <= numifos; i++) {
1008
      for (i = 1; i <= numifos; i++) {
876
	if(ifo[i]) ifoClose(ifo[i]);
1009
        if(ifo[i]) ifoClose(ifo[i]);
877
      }
1010
      }
878
      FREE(ifo);
1011
      FREE(ifo);
879
    
1012
    
Lines 951-963 Link Here
951
  size_t i = 0;
1084
  size_t i = 0;
952
  int b = 0;
1085
  int b = 0;
953
1086
954
  asprintf(&cmd, AUDIOCMDDVD, MPlayer, Dir, c);
1087
  asprintf(&cmd, DVDAUDIO, MPlayer, Dir, c);
955
  FILE *p = popen(cmd, "r");
1088
  FILE *p = popen(cmd, "r");
956
  if (p) {
1089
  if (p) {
957
    if (getline(&buf, &i, p) != -1) {
1090
    if (getline(&buf, &i, p) != -1) {
958
      char *s = strcol(buf, " ", 11);
1091
      char *s = strcol(buf, " ", 11);
959
      if (s) {
1092
      if (s) {
960
	b = atoi(s + sizeof(char));
1093
        b = atoi(s + sizeof(char));
961
        FREE(s);
1094
        FREE(s);
962
      }
1095
      }
963
    }
1096
    }
(-)vdrrip-0.3.0/movie.h (-1 / +21 lines)
Lines 37-47 Link Here
37
37
38
38
39
class cMovie {
39
class cMovie {
40
  private:
41
    bool getByteOffset(int frameindex, int *filenum, int *byteoff);
42
40
  protected:
43
  protected:
41
    bool Dvd;
44
    bool Dvd;
42
    
45
    
43
    char *OrigName;
46
    char *OrigName;
44
    char *Name;
47
    char *Name;
48
    char *Marks;
45
    char *Dir;
49
    char *Dir;
46
    int Length;
50
    int Length;
47
    int FileSize;
51
    int FileSize;
Lines 62-67 Link Here
62
    int CropHeight;
66
    int CropHeight;
63
    int CropPosX;
67
    int CropPosX;
64
    int CropPosY;
68
    int CropPosY;
69
    int StartFrame;
70
    int EndFrame;
71
    int PreviewFileNum;
72
    int PreviewStartByte;
73
    int PreviewFrames;
74
    int FileNum;
75
    int StartByte;
76
    int Frames;
65
    int Bpp;
77
    int Bpp;
66
    int Container;
78
    int Container;
67
    int VCodec;
79
    int VCodec;
Lines 71-77 Link Here
71
    struct AudioData *A;
83
    struct AudioData *A;
72
    char *PPValues;
84
    char *PPValues;
73
    
85
    
74
    char *MarksFile;
75
    char **StrAudioData;
86
    char **StrAudioData;
76
    char **StrAudioData2;
87
    char **StrAudioData2;
77
88
Lines 116-127 Link Here
116
    int getScaleType();
127
    int getScaleType();
117
    int getScaleWidth();
128
    int getScaleWidth();
118
    int getScaleHeight();
129
    int getScaleHeight();
130
    void setCropValues(int width, int height, int posx, int posy);
119
    void setCropValues(int width, int height);
131
    void setCropValues(int width, int height);
120
    bool setCropValues();
132
    bool setCropValues();
121
    int getCropHeight();
133
    int getCropHeight();
122
    int getCropWidth();
134
    int getCropWidth();
123
    int getCropPosX();
135
    int getCropPosX();
124
    int getCropPosY();
136
    int getCropPosY();
137
    int getPreviewFileNum();
138
    int getPreviewStartByte();
139
    int getPreviewFrames();
140
    int getFileNum();
141
    int getStartByte();
142
    int getFrames();
143
    char* getMarks();
125
    void setBpp(int i);
144
    void setBpp(int i);
126
    double getBpp();
145
    double getBpp();
127
    double getResBpp();
146
    double getResBpp();
Lines 142-147 Link Here
142
161
143
    // VDR-Movie
162
    // VDR-Movie
144
    void setLengthVDR();
163
    void setLengthVDR();
164
    void setMarksVDR();
145
    void queryMpValuesVDR();
165
    void queryMpValuesVDR();
146
    void queryAudioDataVDR();
166
    void queryAudioDataVDR();
147
167
(-)vdrrip-0.3.0/queue.c (-13 / +37 lines)
Lines 23-29 Link Here
23
}
23
}
24
24
25
void cQueue::Load() {
25
void cQueue::Load() {
26
  char *buf = NULL;
26
  char *buf = NULL, *tmp = NULL;
27
  size_t i = 0;
27
  size_t i = 0;
28
  int c = 0;
28
  int c = 0;
29
29
Lines 53-63 Link Here
53
      Q[c].PPValues     = strcol(buf, ";", 18);
53
      Q[c].PPValues     = strcol(buf, ";", 18);
54
      Q[c].Rename       = atoi(strcol(buf, ";", 19));
54
      Q[c].Rename       = atoi(strcol(buf, ";", 19));
55
      // migrate from version 0.1.1
55
      // migrate from version 0.1.1
56
      char *cont        = strcol(buf, ";", 20);
56
      tmp = strcol(buf, ";", 20);
57
      cont ? Q[c].Container = cont : Q[c].Container = strdup("avi");
57
      Q[c].Container = (tmp) ? tmp : strdup("avi");
58
      if (tmp != Q[c].Container) { FREE(tmp); }
58
      // migrate from version 0.2.0a
59
      // migrate from version 0.2.0a
59
      char *prev        = strcol(buf, ";", 21);
60
      tmp = strcol(buf, ";", 21);
60
      prev ? Q[c].Preview = atoi(prev) : Q[c].Preview = 0;
61
      Q[c].Preview = (tmp) ? atoi(tmp) : 0;
62
      FREE(tmp);
63
      // migrate from version 0.3.0
64
      tmp = strcol(buf, ";", 22);
65
      Q[c].PreviewFileNum = (tmp) ? atoi(tmp) : 1;
66
      FREE(tmp);
67
      tmp = strcol(buf, ";", 23);
68
      Q[c].PreviewStartByte = (tmp) ? atoi(tmp) : -1;
69
      FREE(tmp);
70
      tmp = strcol(buf, ";", 24);
71
      Q[c].PreviewFrames = (tmp) ? atoi(tmp) : -1;
72
      FREE(tmp);
73
74
      tmp = strcol(buf, ";", 25);
75
      Q[c].FileNum = (tmp) ? atoi(tmp) : 1;
76
      FREE(tmp);
77
      tmp = strcol(buf, ";", 26);
78
      Q[c].StartByte = (tmp) ? atoi(tmp) : -1;
79
      FREE(tmp);
80
      tmp = strcol(buf, ";", 27);
81
      Q[c].Frames = (tmp) ? atoi(tmp) : -1;
82
      FREE(tmp);
61
83
62
      FREE(buf);
84
      FREE(buf);
63
      c++;
85
      c++;
Lines 84-96 Link Here
84
  if (q) {
106
  if (q) {
85
    for (c = 0; c < NumMovies; c++) {
107
    for (c = 0; c < NumMovies; c++) {
86
      if (strcmp(Q[c].Name, "delete") != 0) {
108
      if (strcmp(Q[c].Name, "delete") != 0) {
87
        fprintf(q,"%s;%s;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%i;%s;%i\n",
109
        fprintf(q,"%s;%s;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%i;%s;%i;%i;%i;%i;%i;%i;%i\n",
88
        Q[c].Dir, Q[c].Name, Q[c].FileSize, Q[c].FileNumbers, Q[c].VCodec,
110
        Q[c].Dir, Q[c].Name, Q[c].FileSize, Q[c].FileNumbers, Q[c].VCodec,
89
        Q[c].BitrateVideo, Q[c].MinQuant, Q[c].MaxQuant, Q[c].CropWidth,
111
        Q[c].BitrateVideo, Q[c].MinQuant, Q[c].MaxQuant, Q[c].CropWidth,
90
        Q[c].CropHeight, Q[c].CropPosX, Q[c].CropPosY, Q[c].ScaleWidth,
112
        Q[c].CropHeight, Q[c].CropPosX, Q[c].CropPosY, Q[c].ScaleWidth,
91
        Q[c].ScaleHeight, Q[c].ACodec, Q[c].BitrateAudio, Q[c].AudioID,
113
        Q[c].ScaleHeight, Q[c].ACodec, Q[c].BitrateAudio, Q[c].AudioID,
92
        Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview);
114
        Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview,
93
	n++;
115
        Q[c].PreviewFileNum, Q[c].PreviewStartByte, Q[c].PreviewFrames,
116
        Q[c].FileNum, Q[c].StartByte, Q[c].Frames);
117
        n++;
94
      }
118
      }
95
    }
119
    }
96
    NumMovies = n;
120
    NumMovies = n;
Lines 244-258 Link Here
244
      // check if the content of the lockfile 0
268
      // check if the content of the lockfile 0
245
      int c = fgetc(l);
269
      int c = fgetc(l);
246
      if (c == 48) {
270
      if (c == 48) {
247
	loop   = false;
271
        loop   = false;
248
	Locked = false;
272
        Locked = false;
249
	break;
273
        break;
250
      }
274
      }
251
      
275
      
252
      i++;
276
      i++;
253
      if (i > 2) {
277
      if (i > 2) {
254
	loop   = false;
278
        loop   = false;
255
	Locked = true;
279
        Locked = true;
256
      }
280
      }
257
      isyslog("[vdrrip] %d. try: queuefile is locked by another process", i);
281
      isyslog("[vdrrip] %d. try: queuefile is locked by another process", i);
258
      sleep(1);
282
      sleep(1);
(-)vdrrip-0.3.0/queue.h (+6 lines)
Lines 31-36 Link Here
31
  int Rename;
31
  int Rename;
32
  char *Container;
32
  char *Container;
33
  int Preview;
33
  int Preview;
34
  int PreviewFileNum;
35
  int PreviewStartByte;
36
  int PreviewFrames;
37
  int FileNum;
38
  int StartByte;
39
  int Frames;
34
};
40
};
35
41
36
class cQueue {
42
class cQueue {
(-)vdrrip-0.3.0/scripts/queuehandler.sh (-137 / +182 lines)
Lines 61-69 Link Here
61
# 26.03.2004: 0.3.0: - added evecho function                    #
61
# 26.03.2004: 0.3.0: - added evecho function                    #
62
#                    - added $mencoder_ac3 & $mplayer_ac3       #
62
#                    - added $mencoder_ac3 & $mplayer_ac3       #
63
#                    - added $qh_ver & qh_conf_ver              #
63
#                    - added $qh_ver & qh_conf_ver              #
64
# 23.04.2004: 0.3.1: - change to -dvd if the mencoder-version   #
65
#                      is 0.XX (thx to micmac@www.vdrportal.de) #
66
# 23.09.2007: 0.3.2: - sync to updated mplayer cmdline options  #
67
#                      -vop => -vf and filters are not applied  #
68
#                      in reverse order anymore                 #
64
#                                                               #
69
#                                                               #
65
#################################################################
70
#################################################################
66
qh_ver="0.3.0"
71
qh_ver="0.3.2"
67
72
68
73
69
function initialize () {
74
function initialize () {
Lines 72-78 Link Here
72
#
77
#
73
  
78
  
74
  scriptname=`basename $0`
79
  scriptname=`basename $0`
75
  scriptdir=`dirname $0`
80
  scriptdir=/etc/vdr/plugins/vdrrip
76
81
77
  cfgfile="$scriptname.conf"
82
  cfgfile="$scriptname.conf"
78
83
Lines 92-97 Link Here
92
    log_error "usage: $scriptname queuefile tempdir" 1
97
    log_error "usage: $scriptname queuefile tempdir" 1
93
  fi
98
  fi
94
99
100
  mkdir -p "$tempdir"
95
  if [ ! -d "$tempdir" ]
101
  if [ ! -d "$tempdir" ]
96
  then
102
  then
97
    log_error "directory $tempdir doesn't exist, aborting !" 1
103
    log_error "directory $tempdir doesn't exist, aborting !" 1
Lines 101-107 Link Here
101
107
102
  local pids=`pgrep -d" " "$scriptname"`
108
  local pids=`pgrep -d" " "$scriptname"`
103
  local pid1=`echo "$pids" | cut -d" " -f1`
109
  local pid1=`echo "$pids" | cut -d" " -f1`
104
  local pid2=`echo "$pids" | cut -d" " -f3`
110
  local pid2=`echo "$pids" | cut -d" " -f2`
105
111
106
  if [ "$pid1" != "$pid2" ]
112
  if [ "$pid1" != "$pid2" ]
107
  then
113
  then
Lines 135-141 Link Here
135
  IFS=";"
141
  IFS=";"
136
  read dir name filesize filenumbers vcodec br_video min_q max_q \
142
  read dir name filesize filenumbers vcodec br_video min_q max_q \
137
  crop_w crop_h crop_x crop_y scale_w scale_h acodec br_audio audio_id \
143
  crop_w crop_h crop_x crop_y scale_w scale_h acodec br_audio audio_id \
138
  ppvalues rename container preview < "$queuefile"
144
  ppvalues rename container preview prevfnum prevsb prevframes \
145
  fnum sb frames < "$queuefile"
139
  IFS=$saveifs
146
  IFS=$saveifs
140
147
141
  # there is an active encoding
148
  # there is an active encoding
Lines 156-164 Link Here
156
  fi
163
  fi
157
164
158
  if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi
165
  if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi
159
166
  
160
  dvd=`echo "$dir" | grep "^dvd://"`
167
  dvd=`echo "$dir" | grep "^dvd://"`
161
168
    
162
  if [ "$preview" = "1" ]
169
  if [ "$preview" = "1" ]
163
  then
170
  then
164
    local mode="preview"
171
    local mode="preview"
Lines 214-219 Link Here
214
    mc=$mencoder
221
    mc=$mencoder
215
    mp=$mplayer
222
    mp=$mplayer
216
  fi
223
  fi
224
  
225
  # change the dvd-parameter to -dvd if the mencoder-version is 0.XX
226
  if [ "$dvd" ]
227
  then
228
    local menc_ver=`$mc -v 2>/dev/null | grep "MEncoder" | sed "s/^MEncoder \(.\).*/\1/"`
229
    if [ "$menc_ver" = "0" ]
230
    then
231
      dvd=`echo "$dvd" | sed "s/^dvd:\/\//-dvd /"`
232
    fi
233
    log_debug "dvd: $dvd"
234
  fi
217
235
218
  # check needed tools  
236
  # check needed tools  
219
  case "$container" in
237
  case "$container" in
Lines 229-240 Link Here
229
247
230
      if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ]
248
      if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ]
231
      then
249
      then
232
	check_exe "$ffmpeg" "ffmpeg="
250
        check_exe "$ffmpeg" "ffmpeg="
233
      fi
251
      fi
234
      
252
      
235
      if [ $filenumbers -gt 1 ]
253
      if [ $filenumbers -gt 1 ]
236
      then
254
      then
237
	check_exe "$ogmsplit" "ogmsplit="
255
        check_exe "$ogmsplit" "ogmsplit="
238
      fi
256
      fi
239
      ;;
257
      ;;
240
    "matroska")
258
    "matroska")
Lines 243-249 Link Here
243
261
244
      if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ]
262
      if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ]
245
      then
263
      then
246
	check_exe "$ffmpeg" "ffmpeg="
264
        check_exe "$ffmpeg" "ffmpeg="
247
      fi
265
      fi
248
      ;;
266
      ;;
249
    *)
267
    *)
Lines 255-261 Link Here
255
273
256
function calc_steps () {
274
function calc_steps () {
257
#
275
#
258
# calculate the nuber of encoding-steps
276
# calculate the number of encoding-steps
259
#
277
#
260
  if [ "$error" ]; then return
278
  if [ "$error" ]; then return
261
  elif [ "$preview" = "1" ]
279
  elif [ "$preview" = "1" ]
Lines 271-285 Link Here
271
  
289
  
272
  case "$container" in
290
  case "$container" in
273
    "avi")
291
    "avi")
274
      let steps=steps-4
292
      let steps=steps-5
275
      if [ "$dvd" ]; then let steps=steps-1
276
      elif [ ! -e "$dir/002.vdr" ]; then let steps=steps-1; fi
277
      ;;
293
      ;;
278
    "ogm")
294
    "ogm")
279
      let steps=steps-2
295
      let steps=steps-2
280
      if [ "$acodec" = "copy" -a $audio_id -ge 128 ]
296
      if [ "$acodec" = "copy" -a $audio_id -ge 128 ]
281
      then
297
      then
282
	let steps=steps-1
298
        let steps=steps-1
283
      fi
299
      fi
284
      ;;
300
      ;;
285
    "matroska")
301
    "matroska")
Lines 301-311 Link Here
301
317
302
  name="$name(preview)"
318
  name="$name(preview)"
303
  shortname="$shortname(preview)"
319
  shortname="$shortname(preview)"
304
  
305
  # start the preview in the middle of the movie
306
  local length=`"$mp" -identify -frames 0 "$dir/001.vdr" 2>/dev/null | grep ID_LENGTH | cut -d"=" -f2`
307
  let local ss=length/2
308
  previewval="-ss $ss -endpos $previewlength"
309
}
320
}
310
321
311
322
Lines 316-342 Link Here
316
  if [ "$error" ]; then return
327
  if [ "$error" ]; then return
317
  elif [ "$dvd" ]; then return; fi
328
  elif [ "$dvd" ]; then return; fi
318
329
330
  # Recreate $tempdir if removed by vdr housekeeping
331
  mkdir -p "$tempdir"
332
  if [ ! -d "$tempdir" ]; then return; fi
333
  cd "$tempdir"
334
319
  case "$container" in
335
  case "$container" in
320
    "avi")
321
      # join all vdr-files to $tempdir/temp.vdr
322
      if [ -e "$dir/002.vdr" -a "$preview" != "1" ]
323
      then
324
        log_info "joining all vdr-files from directory $dir"
325
	evecho "joining vdr-files"
326
        nice -+19 cat $dir/[0-9][0-9][0-9].vdr > "$tempdir/temp.vdr"
327
     else
328
	create_symbolic_link
329
      fi
330
      ;;
331
    "ogm"|"matroska")
336
    "ogm"|"matroska")
332
      # demux vdr-recording with vdrsync
337
      # demux vdr-recording with vdrsync
333
      if [ "$preview" = "1" ]
338
      if [ "$preview" != "1" ]
334
      then
339
      then
335
        create_symbolic_link
336
      else
337
        log_info "demuxing all vdr-files from directory $dir"
340
        log_info "demuxing all vdr-files from directory $dir"
338
	evecho "demuxing vdr-files"
341
        evecho "demuxing vdr-files"
339
        execute "$vdrsync $dir -o $tempdir"
342
        execute "$vdrsync $dir -o $tempdir"
343
        # vdrsync 0.1.2.2 developer version creates bd.mpa
344
        if [ -e "$tempdir/bd.mpa" ]
345
        then
346
          mv "$tempdir/bd.mpa" "$tempdir/bd.ac3"
347
        fi
340
      fi
348
      fi
341
      ;;
349
      ;;
342
    *)
350
    *)
Lines 345-369 Link Here
345
}
353
}
346
354
347
355
348
function create_symbolic_link() {
349
#
350
# creates a symbolic link of 001.vdr to $temdir/temp.vdr
351
#
352
  if [ "$error" ]; then return
353
  elif [ "$dvd" ]; then return; fi
354
355
  log_info "create a symbolic link from $dir/001.vdr to $tempdir/temp.vdr"
356
  ln -s "$dir/001.vdr" "$tempdir/temp.vdr"
357
358
  if [ ! -e "$tempdir/temp.vdr" ]
359
  then
360
    log_info "could not create a symolic link"
361
    log_info "try to copy $dir/001.vdr to $tempdir/temp.vdr"
362
    execute "cp $dir/001.vdr $tempdir/temp.vdr"
363
  fi
364
}
365
366
367
function check_exe () {
356
function check_exe () {
368
#
357
#
369
# checks if $1 is a executable and exit the queuehandler with
358
# checks if $1 is a executable and exit the queuehandler with
Lines 389-406 Link Here
389
      case "$acodec" in
378
      case "$acodec" in
390
        "lame")
379
        "lame")
391
          if [ "$dvd" ]
380
          if [ "$dvd" ]
392
	  then
381
          then
393
            local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2:vol=8 -aid $audio_id"
382
            local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2:vol=8 -aid $audio_id"
394
	  else
383
          else
395
            local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2 -aid $audio_id"
384
            local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2 -aid $audio_id"
396
	  fi
385
          fi
397
          ;;
386
          ;;
398
        "copy")
387
        "copy")
399
          local aopts="-oac copy -aid $audio_id"
388
          local aopts="-oac copy -aid $audio_id"
400
          ;;
389
          ;;
401
	"ogg-vorbis")
390
        "ogg-vorbis")
402
          # this shouldn't happen
391
          # this shouldn't happen
403
	  ;;
392
          ;;
404
        *)
393
        *)
405
          log_error "unknown audio codec $acodec"
394
          log_error "unknown audio codec $acodec"
406
          ;;
395
          ;;
Lines 410-424 Link Here
410
      local aopts="-nosound"
399
      local aopts="-nosound"
411
      case "$acodec" in
400
      case "$acodec" in
412
        "lame"|"ogg-vorbis")
401
        "lame"|"ogg-vorbis")
413
	  if [ "$dvd" ]; then dump_audio_mplayer; fi
402
          if [ "$dvd" ]; then dump_audio_mplayer; fi
414
          encode_ffmpeg
403
          encode_ffmpeg
415
	  ;;
404
          ;;
416
        "copy")
405
        "copy")
417
          # convert mp2-files to ac3, because
406
          # convert mp2-files to ac3, because
418
          # mp2 isn't supported by ogm
407
          # mp2 isn't supported by ogm
419
	  if [ "$dvd" ]; then dump_audio_mplayer; fi
408
          if [ "$dvd" ]; then dump_audio_mplayer; fi
420
	  if [ $audio_id -lt 128 ]; then encode_ffmpeg; fi
409
          if [ $audio_id -lt 128 ]; then encode_ffmpeg; fi
421
	  ;;
410
          ;;
422
        *)
411
        *)
423
          log_error "unknown audio codec $acodec"
412
          log_error "unknown audio codec $acodec"
424
          ;;
413
          ;;
Lines 428-439 Link Here
428
      local aopts="-nosound"
417
      local aopts="-nosound"
429
      case "$acodec" in
418
      case "$acodec" in
430
        "lame"|"ogg-vorbis")
419
        "lame"|"ogg-vorbis")
431
	  if [ "$dvd" ]; then dump_audio_mplayer; fi
420
          if [ "$dvd" ]; then dump_audio_mplayer; fi
432
          encode_ffmpeg
421
          encode_ffmpeg
433
	  ;;
422
          ;;
434
        "copy")
423
        "copy")
435
	  if [ "$dvd" ]; then dump_audio_mplayer; fi
424
          if [ "$dvd" ]; then dump_audio_mplayer; fi
436
	  ;;
425
          ;;
437
        *)
426
        *)
438
          log_error "unknown audio codec $acodec"
427
          log_error "unknown audio codec $acodec"
439
          ;;
428
          ;;
Lines 443-489 Link Here
443
      ;;
432
      ;;
444
  esac
433
  esac
445
434
446
  # set mencoder -vop values
435
  # handle interlacing passthrough request
447
  if [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
436
  local mintopts=""
448
       "$crop_y" = "-1" -a "$scale_w" = "-1" -a "$scale_h" = "-1" ]
437
  local xintopts=""
438
  if [ "${ppvalues#codec_does_il}" != "$ppvalues" ]
449
  then
439
  then
450
    local vopopts=""
440
    local mintopts="ildct:ilme"
451
  elif [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
441
    local xintopts="interlacing"
452
         "$crop_y" = "-1" ]
442
    ppvalues = ${ppvalues#codec_does_il}
453
  then
443
    ppvalues = ${ppvalues#/} # if other pp options follow
454
    local vopopts="scale=$scale_w:$scale_h"
455
  else
456
    local vopopts="scale=$scale_w:$scale_h,crop=$crop_w:$crop_h:$crop_x:$crop_y"
457
  fi
444
  fi
458
445
459
  if [ "$ppvalues" ]
446
  # build mencoder filterlist
447
  local vfopts="$ppvalues"
448
449
  if [ ! "$crop_w $crop_h $crop_x $crop_y" = "-1 -1 -1 -1" ]
460
  then
450
  then
461
    local vopopts="-vop pp=$ppvalues,$vopopts"
451
    local vfopts="${vfopts},crop=$crop_w:$crop_h:$crop_x:$crop_y"
462
  elif [ "$vopopts" ]
452
  fi
453
454
  if [ ! "$scale_w $scale_h" = "-1 -1" ]
463
  then
455
  then
464
    local vopopts="-vop $vopopts"
456
    local vfopts="${vfopts},scale=$scale_w:$scale_h"
465
  fi
457
  fi
466
458
459
  # remove possible leading ","
460
  local vfopts="-vf ${vfopts#,}"
461
467
  # encode in two passes 
462
  # encode in two passes 
468
  for pass in 1 2
463
  for pass in 1 2
469
  do
464
  do
470
    if [ "$pass" = "1" ]
465
    if [ "$pass" = "1" ]
471
    then
466
    then
472
      local ofile="-o /dev/null"
467
      local ofile="-o /dev/null"
468
      local mturbo=":turbo"
469
      local xturbo=":turbo"
473
    else
470
    else
474
      local ofile="-o $tempdir/$name.avi"
471
      local ofile="-o $tempdir/$name.avi"
472
      if [ "$useropts_lavc" ]; then
473
        log_info "\$useropts_lavc are set to \"$useropts_lavc\""
474
        mturbo="$mturbo:$useropts_lavc"
475
      fi
476
      if [ "$mintopts" ]; then
477
        log_info "Encoding an interlaced stream with \"$mintopts\""
478
        mturbo="$mturbo:$mintopts"
479
      fi
480
      if [ "$useropts_xvid" ]; then
481
        log_info "\$useropts_xvid are set to \"$useropts_xvid\""
482
        xturbo="$xturbo:$useropts_xvid"
483
      fi
484
      if [ "$xintopts" ]; then
485
        log_info "Encoding an interlaced stream with \"$xintopts\""
486
        xturbo="$xturbo:$xintopts"
487
      fi
475
    fi
488
    fi
476
489
477
    # set mencoder video values
490
    # set mencoder video values
478
    case "$vcodec" in
491
    case "$vcodec" in
479
      "lavc")
492
      "lavc")
480
        local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass -sws 2"
493
        local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass$mturbo -sws 2"
481
        ;;
494
        ;;
482
      "xvid")
495
      "xvid")
483
        local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass -sws 2"
496
        local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass$xturbo -sws 2"
484
        ;;
485
      "divx4")
486
        local vopts="-ovc divx4 -divx4opts br=$br_video:q=5:min_quant=$min_q:max_quant=$max_q:pass=$pass -sws 2"
487
        ;;
497
        ;;
488
      *)
498
      *)
489
        log_error "unknown video codec $vcodec"
499
        log_error "unknown video codec $vcodec"
Lines 498-504 Link Here
498
    elif [ "$container" = "avi" -o "$preview" = "1" ]
508
    elif [ "$container" = "avi" -o "$preview" = "1" ]
499
    then
509
    then
500
      # no dvd, avi container
510
      # no dvd, avi container
501
      local ifile="$tempdir/temp.vdr"
511
      if [ -e "$dir/002.vdr" ]
512
      then
513
        local ifile="$tempdir/temp.vdr"
514
        local vopts="-cache 4096 $vopts"
515
516
        if [ "$preview" = "1" ]
517
        then
518
          startpiping $prevfnum $dir/[0-9][0-9][0-9].vdr
519
        else
520
          startpiping $fnum $dir/[0-9][0-9][0-9].vdr
521
        fi
522
      else
523
        local ifile="$dir/001.vdr"
524
      fi
525
526
      # since the other containers use vdrsync, which handles vdr marks??
527
      # use the following only for avi (which is always used for preview too)
528
      if [ "$preview" = "1" ]
529
      then
530
        if [ $prevframes -gt 0 ]; then local vopts="-frames $prevframes $vopts" ; fi
531
        if [ "$prevsb" != "-1" ]; then local vopts="-sb $prevsb $vopts" ; fi
532
      else
533
        if [ $frames -gt 0 ]; then local vopts="-frames $frames $vopts" ; fi
534
        if [ "$sb" != "-1" ]; then local vopts="-sb $sb $vopts" ; fi
535
      fi
502
    else
536
    else
503
      # no dvd, ogm/matroska container
537
      # no dvd, ogm/matroska container
504
538
Lines 507-525 Link Here
507
      while [ ! "$ifile" ]
541
      while [ ! "$ifile" ]
508
      do
542
      do
509
        if [ ! -e "$tempdir/e$num.mpv" ]
543
        if [ ! -e "$tempdir/e$num.mpv" ]
510
	then
544
        then
511
	  log_info "video-file $tempdir/e$num.mpv not found !"
545
          log_info "video-file $tempdir/e$num.mpv not found !"
512
	  if [ $num -ge 9 ]
546
          if [ $num -ge 9 ]
513
	  then
547
          then
514
	      log_error "no video-stream found !"
548
            log_error "no video-stream found !"
515
              # exit loop
549
            # exit loop
516
              local ifile="dummy"
550
            local ifile="dummy"
517
	    fi
551
          fi
518
	    let num=num+1
552
          let num=num+1
519
        else	  
553
        else      
520
	  log_info "video-file $tempdir/e$num.mpv found !"
554
          log_info "video-file $tempdir/e$num.mpv found !"
521
          local ifile="$tempdir/e$num.mpv"
555
          local ifile="$tempdir/e$num.mpv"
522
	fi
556
        fi
523
      done
557
      done
524
    fi
558
    fi
525
559
Lines 536-542 Link Here
536
570
537
    evecho "enc. $encstr ($pass. pass)"
571
    evecho "enc. $encstr ($pass. pass)"
538
    if [ "$useropts" ]; then log_info "\$useropts are set to \"$useropts\""; fi
572
    if [ "$useropts" ]; then log_info "\$useropts are set to \"$useropts\""; fi
539
    execute "$mc $ifile $ofile $useropts $vopts $vopopts $aopts $previewval"
573
    execute "$mc $useropts $vopts $vfopts $aopts $ifile $ofile"
540
  done
574
  done
541
}
575
}
542
576
Lines 593-599 Link Here
593
627
594
function merge_ogm_mkv() {
628
function merge_ogm_mkv() {
595
  if [ "$error" ]; then return; fi
629
  if [ "$error" ]; then return; fi
596
  if [ "$container" != "ogm" -a "$container" != "matroska" ]; then return; fi
630
  if [ "$container" != "ogm" -a "$container" != "matroska" -o "$preview" = "1" ]; then return; fi
597
    
631
    
598
632
599
  case "$container" in
633
  case "$container" in
Lines 610-642 Link Here
610
  esac
644
  esac
611
645
612
646
613
  if [ "$preview" != "1" ]
647
  case "$acodec" in
614
  then
648
    "lame")
615
    case "$acodec" in
649
      local afile="$tempdir/c$audio_id.mp3"
616
      "lame")
650
      ;;
617
        local afile="$tempdir/c$audio_id.mp3"
651
    "ogg-vorbis")
618
        ;;
652
      local afile="$tempdir/c$audio_id.ogg"
619
      "ogg-vorbis")
653
      ;;
620
	local afile="$tempdir/c$audio_id.ogg"
654
    "copy")
621
	;;
655
      if [ $audio_id -ge 128 ]
622
      "copy")
656
      then
623
        if [ $audio_id -ge 128 ]
657
        # ac3
624
        then
658
        local afile="$tempdir/bd.ac3"
625
          # ac3
659
      elif [ "$container" = "ogm" ]
626
	  local afile="$tempdir/bd.ac3"
660
      then
627
	elif [ "$container" = "ogm" ]
661
        # mpg2, container ogm
628
	then
662
        local afile="$tempdir/c$audio_id.ac3"
629
	  # mpg2, container ogm
663
      else
630
	  local afile="$tempdir/c$audio_id.ac3"
664
        # mpg2
631
	else
665
        local afile="$tempdir/c$audio_id.mpa"
632
          # mpg2
666
      fi
633
	  local afile="$tempdir/c$audio_id.mpa"
667
      ;;
634
	fi
668
    *)
635
        ;;
669
      ;;
636
      *)
670
  esac
637
        ;;
638
    esac
639
  fi
640
671
641
  log_info "merging movie $shortname into $filetype-container"
672
  log_info "merging movie $shortname into $filetype-container"
642
  evecho "merging into $filetype-container"
673
  evecho "merging into $filetype-container"
Lines 702-708 Link Here
702
  mp=""
733
  mp=""
703
  
734
  
704
  dvd=""
735
  dvd=""
705
  previewval=""
706
  error=""
736
  error=""
707
737
708
  step="0"
738
  step="0"
Lines 729-736 Link Here
729
    rm -f "$queuefile"
759
    rm -f "$queuefile"
730
  else
760
  else
731
    let lines=lines-1
761
    let lines=lines-1
732
    tail -n $lines "$queuefile" > /tmp/queuefile.tmp
762
    cp -a "$queuefile" /tmp/queuefile.tmp
733
    mv /tmp/queuefile.tmp $queuefile
763
    tail -n $lines /tmp/queuefile.tmp > "$queuefile"
734
  fi
764
  fi
735
765
736
  if [ "$error" ]
766
  if [ "$error" ]
Lines 780-789 Link Here
780
        # split file
810
        # split file
781
        execute "$mc -ovc copy -oac copy $tempdir/$name.avi \
811
        execute "$mc -ovc copy -oac copy $tempdir/$name.avi \
782
                 -ss $splitpos $endpos -o $tempdir/$ofile"
812
                 -ss $splitpos $endpos -o $tempdir/$ofile"
783
	
813
        
784
        # detect length of splitted file and add it to $splitpos
814
        # detect length of splitted file and add it to $splitpos
785
        local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
815
        local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
786
                      grep ID_LENGTH | cut -d= -f2`
816
                      grep ID_LENGTH | cut -d= -f2`
817
        # repeat command if failed first time
818
        if [ -z "$length" ]
819
        then
820
            length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
821
                    grep ID_LENGTH | cut -d= -f2`
822
        fi
787
        let splitpos=splitpos+length-overlap
823
        let splitpos=splitpos+length-overlap
788
        let count=count+1
824
        let count=count+1
789
      done
825
      done
Lines 832-838 Link Here
832
#
868
#
833
# echo $1 on stderr and write it to the syslog with priority user.error
869
# echo $1 on stderr and write it to the syslog with priority user.error
834
#
870
#
835
  logger -s -p user.error -t [vdrrip-qh] "$1"
871
  logger -s -p user.error -t vdrrip-qh "$1"
836
872
837
  if [ "$2" ]
873
  if [ "$2" ]
838
  then
874
  then
Lines 848-854 Link Here
848
#
884
#
849
# echo $1 on stdout and write it to the syslog with priority user.info
885
# echo $1 on stdout and write it to the syslog with priority user.info
850
#
886
#
851
  logger -s -p user.info -t [vdrrip-qh] "$1" 2>&1
887
  logger -s -p user.info -t vdrrip-qh "$1" 2>&1
852
}
888
}
853
889
854
890
Lines 858-864 Link Here
858
#
894
#
859
  if [ "$debug" = "1" ]
895
  if [ "$debug" = "1" ]
860
  then
896
  then
861
    logger -s -p user.debug -t [vdrrip-qh] "$1"
897
    logger -s -p user.debug -t vdrrip-qh "$1"
862
  fi
898
  fi
863
}
899
}
864
900
Lines 874-883 Link Here
874
  # execute $cmd and save the return-code:
910
  # execute $cmd and save the return-code:
875
  if [ "$stdout" = "1" ]
911
  if [ "$stdout" = "1" ]
876
  then
912
  then
877
    nice -+19 $cmd 2>/tmp/queuehandler.err
913
    nice -n 19 $cmd 2>/tmp/queuehandler.err
878
    local rc="$?"
914
    local rc="$?"
879
  else
915
  else
880
    nice -+19 $cmd 1>/dev/null 2>/tmp/queuehandler.err
916
    nice -n 19 $cmd 1>/dev/null 2>/tmp/queuehandler.err
881
    local rc="$?"
917
    local rc="$?"
882
  fi
918
  fi
883
919
Lines 921-926 Link Here
921
}
957
}
922
958
923
959
960
function startpiping () {
961
  shift $1
962
        
963
  rm -f "$tempdir/temp.vdr"
964
  mkfifo "$tempdir/temp.vdr"
965
966
  cat $@ > "$tempdir/temp.vdr" &
967
}
968
924
function wait_unlock () {
969
function wait_unlock () {
925
#
970
#
926
# wait until the queuefile is unlocked
971
# wait until the queuefile is unlocked
(-)vdrrip-0.3.0/scripts/queuehandler.sh.conf (-10 / +21 lines)
Lines 33-48 Link Here
33
33
34
  # this pathes are used for the encoding of vdr-recordings & dvd's.
34
  # this pathes are used for the encoding of vdr-recordings & dvd's.
35
  # they _must_ point to an unpatched mencoder & mplayer
35
  # they _must_ point to an unpatched mencoder & mplayer
36
  mencoder="/usr/local/bin/mencoder"
36
  mencoder="/usr/bin/mencoder"
37
  mplayer="/usr/local/bin/mplayer"
37
  mplayer="/usr/bin/mplayer"
38
38
39
  # this pathes are only used for encoding a vdr-recording with
39
  # this pathes are only used for encoding a vdr-recording with
40
  # selected ac3-stream.
40
  # selected ac3-stream.
41
  # they _must_ point to an ac3-patched mencoder & mplayer.
41
  # they _must_ point to an ac3-patched mencoder & mplayer.
42
  # if you don't use this feature you should deactivate the option
42
  # if you don't use this feature you should deactivate the option
43
  # AC3 Support (MPlayer-patch inst.) in the plugins setup-menu.
43
  # AC3 Support (MPlayer-patch inst.) in the plugins setup-menu.
44
  mencoder_ac3="/usr/local/bin/mencoder_ac3"
44
  mencoder_ac3="/usr/bin/mencoder"
45
  mplayer_ac3="/usr/local/bin/mplayer_ac3"
45
  mplayer_ac3="/usr/bin/mplayer"
46
46
47
47
48
  # this string is added to the mencoder-command in the
48
  # this string is added to the mencoder-command in the
Lines 52-62 Link Here
52
52
53
53
54
  # optional tools (only needed for ogm/matroska-container)
54
  # optional tools (only needed for ogm/matroska-container)
55
  vdrsync="/usr/local/bin/vdrsync.pl"
55
  vdrsync="/usr/bin/vdrsync.pl"
56
  ffmpeg="/usr/local/bin/ffmpeg"
56
  ffmpeg="/usr/bin/ffmpeg"
57
  ogmmerge="/usr/local/bin/ogmmerge"
57
  ogmmerge="/usr/bin/ogmmerge"
58
  ogmsplit="/usr/local/bin/ogmsplit"
58
  ogmsplit="/usr/bin/ogmsplit"
59
  mkvmerge="/usr/local/bin/mkvmerge"
59
  mkvmerge="/usr/bin/mkvmerge"
60
60
61
61
62
62
Lines 64-71 Link Here
64
  # from the queuehandler on your tv.
64
  # from the queuehandler on your tv.
65
  # You have to specify only $svdrpsend or $netcat.
65
  # You have to specify only $svdrpsend or $netcat.
66
  # $netcat is only recommend, if perl isn't installed.
66
  # $netcat is only recommend, if perl isn't installed.
67
  svdrpsend="/usr/local/bin/svdrpsend.pl"
67
  svdrpsend="/usr/bin/svdrpsend.pl"
68
  #netcat=""
68
  #netcat=""
69
69
70
  vdrhostname="localhost"
70
  vdrhostname="localhost"
71
71
72
  # These are the options beside the bitrate and eventually the 
73
  # interlace options passed to mencoder you can control the 
74
  # quality of the encoding by changing them here
75
76
  useropts_lavc=""
77
  # For a high quality high bitrate encoding use:
78
  #useropts_lavc="mbd=2:trell:cbp:mv0:cmp=3:subcmp=3"
79
  useropts_xvid=""
80
  # For a high quality high bitrate encoding use:
81
  #useropts_xvid="me_quality=6:vhq=1:notrellis:max_bframes=2"
82
(-)vdrrip-0.3.0/templates.c (-4 / +4 lines)
Lines 87-96 Link Here
87
    for (int c = 0; c < NumTemplates; c++) {
87
    for (int c = 0; c < NumTemplates; c++) {
88
      if (strcmp(T[c].Name, "delete") != 0) {
88
      if (strcmp(T[c].Name, "delete") != 0) {
89
        fprintf(f, "%s;%i;%i;%i;%i;%s;%s;%i;%i;%s\n", T[c].Name,
89
        fprintf(f, "%s;%i;%i;%i;%i;%s;%s;%i;%i;%s\n", T[c].Name,
90
	        T[c].FileSize, T[c].FileNumbers, T[c].BitrateVideo,
90
                T[c].FileSize, T[c].FileNumbers, T[c].BitrateVideo,
91
		T[c].BitrateAudio, C->getVCodec(T[c].VCodec),
91
                T[c].BitrateAudio, C->getVCodec(T[c].VCodec),
92
		C->getACodec(T[c].ACodec), T[c].ScaleType, T[c].Bpp,
92
                C->getACodec(T[c].ACodec), T[c].ScaleType, T[c].Bpp,
93
		C->getContainer(T[c].Container));
93
                C->getContainer(T[c].Container));
94
      }
94
      }
95
    }
95
    }
96
    fclose(f);
96
    fclose(f);
(-)vdrrip-0.3.0/vdrrip.c (-2 / +10 lines)
Lines 69-77 Link Here
69
#endif // VDRRIP_DVD
69
#endif // VDRRIP_DVD
70
           , MPlayer, MEncoder
70
           , MPlayer, MEncoder
71
#ifdef VDRRIP_DVD
71
#ifdef VDRRIP_DVD
72
	   , DVD
72
           , DVD
73
#endif // VDRRIP_DVD
73
#endif // VDRRIP_DVD
74
	   );
74
           );
75
  return s;
75
  return s;
76
}
76
}
77
77
Lines 132-144 Link Here
132
  if (access(MPlayer, X_OK) == -1) {
132
  if (access(MPlayer, X_OK) == -1) {
133
    char *s = NULL;
133
    char *s = NULL;
134
    asprintf(&s, "%s doesn't exist or isn't a executable !", MPlayer);
134
    asprintf(&s, "%s doesn't exist or isn't a executable !", MPlayer);
135
#if VDRVERSNUM >= 10307
136
    Skins.Message(mtError, s);
137
#else
135
    Interface->Error(s);
138
    Interface->Error(s);
139
#endif
136
    FREE(s);
140
    FREE(s);
137
    return NULL;
141
    return NULL;
138
  } else if (access(MEncoder, X_OK) == -1) {
142
  } else if (access(MEncoder, X_OK) == -1) {
139
    char *s = NULL;
143
    char *s = NULL;
140
    asprintf(&s, "%s doesn't exist or isn't a executable !", MEncoder);
144
    asprintf(&s, "%s doesn't exist or isn't a executable !", MEncoder);
145
#if VDRVERSNUM >= 10307
146
    Skins.Message(mtError, s);
147
#else
141
    Interface->Error(s);
148
    Interface->Error(s);
149
#endif
142
    FREE(s);
150
    FREE(s);
143
    return NULL;
151
    return NULL;
144
  } else return new cMenuVdrrip();
152
  } else return new cMenuVdrrip();
(-)vdrrip-0.3.0/vdrriprecordings.c (-1 / +1 lines)
Lines 10-16 Link Here
10
#include "vdrriprecordings.h"
10
#include "vdrriprecordings.h"
11
#include "a-tools.h"
11
#include "a-tools.h"
12
12
13
#define FINDRECCMD "find %s -follow -type d -regex '.*rec$'"
13
#define FINDRECCMD "find %s -follow -type d -regex '.*rec$' | sort"
14
14
15
// --- cVdrripRecordings -----------------------
15
// --- cVdrripRecordings -----------------------
16
16

Return to bug 193865