Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 132147 Details for
Bug 193865
media-plugins/vdr-vdrrip-0.3.0-r7 to r8 enhancements/bugfixes
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/vdrrip-0.3.0-20070925-vdr1.3.7-mplayer-merged.diff - updated2
vdrrip-0.3.0-20070925-vdr1.3.7-mplayer-merged.diff (text/plain), 73.06 KB, created by
cmuelle8
on 2007-09-29 04:17:12 UTC
(
hide
)
Description:
files/vdrrip-0.3.0-20070925-vdr1.3.7-mplayer-merged.diff - updated2
Filename:
MIME Type:
Creator:
cmuelle8
Created:
2007-09-29 04:17:12 UTC
Size:
73.06 KB
patch
obsolete
>diff -ur vdrrip-0.3.0/a-tools.c vdrrip-0.3.0-new/a-tools.c >--- vdrrip-0.3.0/a-tools.c 2004-02-04 19:15:28.000000000 +0100 >+++ vdrrip-0.3.0-new/a-tools.c 2007-09-26 12:11:47.000000000 +0200 >@@ -108,4 +108,7 @@ > return s1; > } > >-int roundValue(int i, int i1) {return i / i1 * i1;} >+int roundValue(int i, int i1) { >+ if (i%i1 > i1/2) {return (i/i1*i1+i1);} >+ else {return (i/i1*i1);} >+} >diff -ur vdrrip-0.3.0/codecs.c vdrrip-0.3.0-new/codecs.c >--- vdrrip-0.3.0/codecs.c 2004-01-25 13:19:03.000000000 +0100 >+++ vdrrip-0.3.0-new/codecs.c 2007-09-28 21:51:57.000000000 +0200 >@@ -66,9 +66,9 @@ > // move found video codec to VCodecs[i1] > char *tmp = VCodecs[c1]; > VCodecs[c1] = VCodecs[c]; >- VCodecs[c] = tmp; >+ VCodecs[c] = tmp; > c1++; >- NumVCodecs++; >+ NumVCodecs++; > } > } > } >@@ -91,9 +91,9 @@ > // switch found audio codec with ACodecs[i1] > char *tmp = ACodecs[c1]; > ACodecs[c1] = ACodecs[c]; >- ACodecs[c] = tmp; >- c1++; >- NumACodecs++; >+ ACodecs[c] = tmp; >+ c1++; >+ NumACodecs++; > } > } > } >diff -ur vdrrip-0.3.0/i18n.c vdrrip-0.3.0-new/i18n.c >--- vdrrip-0.3.0/i18n.c 2004-04-21 18:48:51.000000000 +0200 >+++ vdrrip-0.3.0-new/i18n.c 2007-09-27 02:05:50.000000000 +0200 >@@ -613,7 +613,7 @@ > }, > > { "expert modus(off)", >- "Exp.-Modus(aus)", >+ "Einfach", > "",// TODO > "Modo esperto(off)", > "",// TODO >@@ -634,7 +634,7 @@ > }, > > { "expert modus(on)", >- "Exp.-Modus(ein)", >+ "Experte", > "",// TODO > "Modo esperto(on)", > "",// TODO >@@ -718,7 +718,7 @@ > }, > > { "CropData", >- "Schnitt-Daten", >+ "Bildschnitt-Info", > "",// TODO > "Valori di taglio", > "",// TODO >@@ -738,6 +738,27 @@ > #endif > }, > >+ { "RangeData", >+ "Zeitlaufgrenzen", >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+#if VDRVERSNUM>10301 >+ "",// TODO >+#endif >+ }, >+ > { "ScaleData", > "Skalierung", > "",// TODO >@@ -885,6 +906,48 @@ > #endif > }, > >+ { "CropPosX", >+ "Startspalte",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+#if VDRVERSNUM>10301 >+ "",// TODO >+#endif >+ }, >+ >+ { "CropPosY", >+ "Startzeile",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+ "",// TODO >+#if VDRVERSNUM>10301 >+ "",// TODO >+#endif >+ }, >+ > { "- postprocessing Filters(%s):", > "- Nachbearbeitungsfilter(%s):", > "",// TODO >diff -ur vdrrip-0.3.0/menu-vdrrip.c vdrrip-0.3.0-new/menu-vdrrip.c >--- vdrrip-0.3.0/menu-vdrrip.c 2004-04-22 20:05:17.000000000 +0200 >+++ vdrrip-0.3.0-new/menu-vdrrip.c 2007-09-29 01:31:38.000000000 +0200 >@@ -4,6 +4,11 @@ > > #include <vdr/plugin.h> > #include <vdr/videodir.h> >+#if VDRVERSNUM >= 10307 >+#include <vdr/interface.h> >+#include <vdr/recording.h> >+#include <vdr/status.h> >+#endif > > #ifdef VDRRIP_DVD > #include <dvdnav/ifo_read.h> >@@ -16,17 +21,18 @@ > #include "queue.h" > #include "vdrriprecordings.h" > >+#define ABS(i) ((i)<0?-(i):(i)) > #define MINQUANT 2 > #define MAXQUANT 15 > > #define NUMSCALETYPES 4 >-#define NUMPPDEINT 6 >+#define NUMPPDEINT 8 > > static const char *ScaleTypes[] = { "off", "auto", "dvb", "manual" }; > static const char *DVBScaleWidths[] = { "352", "480", "544", "688", "704", "720" }; > static const char *DVBScaleHeights[] = { "288", "576" }; > static const char *CropModes[] = { "crop width & height", "crop only height"}; >-static const char *PPDeint[] = { "off", "fd", "lb", "li", "ci", "md", }; >+static const char *PPDeint[] = { "off", "codec_does_il", "fd", "lb", "li", "ci", "md", "l5" }; > > // --- cMenuVdrrip --------------------------------------------------------- > >@@ -92,14 +98,22 @@ > # ifdef VDRRIP_DVD > > cMenuVdrripWarning::cMenuVdrripWarning(const char *Title, const char *Text) >+#if VDRVERSNUM >= 10307 >+:cMenuText(Title, "") >+#else > :cOsdMenu(Title) >+#endif > { > bool warning; > warning = true; > //warning = false; > > if (warning) { >+#if VDRVERSNUM >= 10307 >+ SetText(Text); >+#else > Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, fontOsd)); >+#endif > SetHelp(tr("back"), tr("accept"), NULL, NULL); > hadsubmenu = false; > } else { >@@ -120,6 +134,22 @@ > if (hadsubmenu) {return osBack;} > > switch (Key) { >+#if VDRVERSNUM >= 10307 >+ // cMenuText::ProcessKey don't handle submenus >+ case kUp|k_Repeat: >+ case kUp: >+ case kDown|k_Repeat: >+ case kDown: >+ case kLeft|k_Repeat: >+ case kLeft: >+ case kRight|k_Repeat: >+ case kRight: >+ DisplayMenu()->Scroll(NORMALKEY(Key) == kUp || NORMALKEY(Key) == kLeft, >+ NORMALKEY(Key) == kLeft || NORMALKEY(Key) == kRight); >+ cStatus::MsgOsdTextItem(NULL, NORMALKEY(Key) == kUp); >+ return osContinue; >+#endif >+ > case kRed: return osBack; > > case kGreen: { >@@ -138,13 +168,22 @@ > ifo_handle_t *ifo_zero = NULL; > ifo_handle_t *ifo_tmp = NULL; > >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("checking dvd...")); >+ Skins.Flush(); >+#else > Interface->Status(tr("checking dvd...")); > Interface->Flush(); >+#endif > > if (access(DVD, R_OK) == -1) { > char *s = NULL; > asprintf(&s, "No read privileges on %s !", DVD); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, s); >+#else > Interface->Error(s); >+#endif > FREE(s); > return false; > } >@@ -157,13 +196,17 @@ > for (int i = 1; i < ifo_zero->vts_atrt->nr_of_vtss; i++) { > ifo_tmp = ifoOpen(dvd, i); > if (ifo_tmp) ifoClose(ifo_tmp); >- else { >- char *s = NULL; >- asprintf(&s, "Can't open ifo %d !", i); >- Interface->Error(s); >- FREE(s); >+ else { >+ char *s = NULL; >+ asprintf(&s, "Can't open ifo %d !", i); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, s); >+#else >+ Interface->Error(s); >+#endif >+ FREE(s); > DVDClose(dvd); >- return false; >+ return false; > } > } > ifoClose(ifo_zero); >@@ -171,14 +214,22 @@ > return true; > } else { > DVDClose(dvd); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, "Can't open main ifo from dvd !"); >+#else > Interface->Error("Can't open main ifo from dvd !"); >+#endif > return false; > } > } > > char *s = NULL; > asprintf(&s, "Can 't open %s !", DVD); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, s); >+#else > Interface->Error(s); >+#endif > FREE(s); > return false; > } >@@ -190,8 +241,13 @@ > cMenuVdrripEncode::cMenuVdrripEncode():cOsdMenu(tr("encode vdr-recording")) { > R = NULL; > >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("scanning recordings...")); >+ Skins.Flush(); >+#else > Interface->Status(tr("scanning recordings...")); > Interface->Flush(); >+#endif > > R = new cVdrripRecordings; > Set(); >@@ -259,7 +315,13 @@ > FREE(s1); > } > >- if (Q->getLockStat()) {Interface->Error(tr("the queuefile is locked by the queuehandler !"));} >+ if (Q->getLockStat()) { >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !")); >+#else >+ Interface->Error(tr("the queuefile is locked by the queuehandler !")); >+#endif >+ } > > SetHelpKeys(); > } >@@ -284,8 +346,8 @@ > char *buf = NULL; > asprintf(&buf, tr("delete movie %s from queue ?"), Q->getShortname(NumMovie)); > if (Interface->Confirm(buf)) { >- Q->Del(NumMovie); >- RefreshOSD(); >+ Q->Del(NumMovie); >+ RefreshOSD(); > } > FREE(buf); > } >@@ -294,7 +356,7 @@ > > case kGreen: { > if (Up) { >- Q->Up(NumMovie); >+ Q->Up(NumMovie); > RefreshOSD(); > } > break; >@@ -315,10 +377,10 @@ > } > break; > } >- >+ > default: break; > } >- >+ > return state; > } > >@@ -353,11 +415,13 @@ > } > > void cMenuVdrripQueue::AddColItem(cOsdItem *i) { >+#if VDRVERSNUM < 10307 > #ifdef clrScrolLine > i->SetColor(clrScrolLine, clrBackground); > #else > i->SetColor(clrCyan, clrBackground); > #endif >+#endif > > Add(i); > } >@@ -491,14 +555,14 @@ > Add(new cMenuEditIntItem(tr("BitrateAudio"), &TempOSD.BitrateAudio, 1, 9999)); > } > Add(new cMenuEditStraItem(tr("Container"), &TempOSD.Container, >- T->C->getNumContainers(), T->C->getContainers())); >+ T->C->getNumContainers(), T->C->getContainers())); > Add(new cMenuEditStraItem(tr("Video-Codec"), &TempOSD.VCodec, >- T->C->getNumVCodecs(), T->C->getVCodecs())); >+ T->C->getNumVCodecs(), T->C->getVCodecs())); > Add(new cMenuEditStraItem(tr("Audio-Codec"), &TempOSD.ACodec, >- T->C->getNumACodecs(), T->C->getACodecs())); >+ T->C->getNumACodecs(), T->C->getACodecs())); > Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &TempOSD.Bpp, 1, 99)); > Add(new cMenuEditStraItem(tr("ScaleType"), &TempOSD.ScaleType, >- NUMSCALETYPES, ScaleTypes)); >+ NUMSCALETYPES, ScaleTypes)); > } > > void cMenuVdrripEditTemplate::OSDChange() { >@@ -520,7 +584,7 @@ > > } else if (TempOSD.ACodec != TempOSDsave.ACodec) { > if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 && >- strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) { >+ strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) { > // avi couldn't contain ogg-vorbis audio > T->setCodecs(NumTemplate, TempOSD.VCodec, TempOSDsave.ACodec); > } else { >@@ -531,7 +595,7 @@ > > } else if (TempOSD.Container != TempOSDsave.Container) { > if (strcmp(T->C->getContainer(TempOSD.Container), "avi") == 0 && >- strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) { >+ strcmp(T->C->getACodec(TempOSD.ACodec), "ogg-vorbis") == 0) { > // avi couldn't contain ogg-vorbis audio > T->setContainer(NumTemplate, TempOSDsave.Container); > } else { >@@ -573,7 +637,7 @@ > > default: { > OSDupdate = true; >- break; >+ break; > } > } > } >@@ -584,11 +648,13 @@ > } > > void cMenuVdrripEditTemplate::AddColItem(cOsdItem *i) { >+#if VDRVERSNUM < 10307 > #ifdef clrScrolLine > i->SetColor(clrScrolLine, clrBackground); > #else > i->SetColor(clrCyan, clrBackground); > #endif >+#endif > > Add(i); > } >@@ -600,8 +666,13 @@ > MovOSDsaveName = NULL; > FileSize[0] = MovieData[0] = CropData[0] = ScaleData[0] = NULL; > >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("reading movie-data...")); >+ Skins.Flush(); >+#else > Interface->Status(tr("reading movie-data...")); > Interface->Flush(); >+#endif > > M = new cMovie(p, n); > Init(); >@@ -633,19 +704,21 @@ > if (M->getScaleType() == 2) { > for (int i = 0; i < 6; i++) { > if (atoi(DVBScaleWidths[i]) == M->getScaleWidth()) { >- MovOSD.DVBScaleWidth = i; >+ MovOSD.DVBScaleWidth = i; > } > } > > for (int i = 0; i < 2; i++) { > if (atoi(DVBScaleHeights[i]) == M->getScaleHeight()) { >- MovOSD.DVBScaleHeight = i; >+ MovOSD.DVBScaleHeight = i; > } > } > } > > CropWidthsave = -1; > CropHeightsave = -1; >+ CropPosXsave = -1; >+ CropPosYsave = -1; > > MovOSD.PPDeinterlace = 0; > MovOSD.PPDeblock = 0; >@@ -675,12 +748,17 @@ > > MovOSD.CropWidth = M->getCropWidth(); > MovOSD.CropHeight = M->getCropHeight(); >+ MovOSD.CropPosX = M->getCropPosX(); >+ MovOSD.CropPosY = M->getCropPosY(); > if (M->getPPValues()) { >- if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 1; >- else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 2; >- else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 3; >- else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 4; >- else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 5; >+ if (strstr(M->getPPValues(), "off")) MovOSD.PPDeinterlace = 0; >+ else if (strstr(M->getPPValues(), "codec_does_il")) MovOSD.PPDeinterlace = 1; >+ else if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 2; >+ else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 3; >+ else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 4; >+ else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 5; >+ else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 6; >+ else if (strstr(M->getPPValues(), "l5")) MovOSD.PPDeinterlace = 7; > else MovOSD.PPDeinterlace = 0; > > if (strstr(M->getPPValues(), "hb/vb/dr/al")) MovOSD.PPDeblock = 1; >@@ -716,9 +794,9 @@ > CropReset = true; > > SetHelp(tr("add to queue"), >- Crop ? tr(CropReset ? "reset boarders" : "crop boarders" ) : NULL, >- tr(Expert ? "expert modus(off)" : "expert modus(on)"), >- NULL); >+ Crop ? tr(CropReset ? "reset boarders" : "crop boarders" ) : NULL, >+ tr(Expert ? "expert modus(off)" : "expert modus(on)"), >+ NULL); > } > } > >@@ -779,6 +857,12 @@ > M->getCropHeight(), M->getCalcAspect()); > } > AddColItem(new cMenuEditStraItem(tr("CropData"), &NumStatic, 1, CropData)); >+ >+ // Show what range will be used >+ if (M->getMarks()) { >+ asprintf(&RangeData[0], "%s", M->getMarks()); >+ AddColItem(new cMenuEditStraItem(tr("RangeData"), &NumStatic, 1, RangeData)); >+ } > > > // Bitrate Video >@@ -830,7 +914,7 @@ > case 1: { //ScaleType auto > asprintf(&ScaleData[0], "%i:%i(Asp: %1.2f Bpp: %1.3f)", M->getScaleWidth(), M->getScaleHeight(), (double)M->getScaleWidth() / (double)M->getScaleHeight(), M->getResBpp()); > AddColItem(new cMenuEditStraItem(tr("ScaleData"), &NumStatic, 1, >- ScaleData)); >+ ScaleData)); > Add(new cMenuEditIntItem(tr("Bpp-Value (*100)"), &MovOSD.Bpp, 1, 99)); > break; > } >@@ -856,8 +940,12 @@ > AddColItem(new cOsdItem(tr("------ expert settings: ------"))); > if (MovOSD.CropWidth != -1 && MovOSD.CropHeight != -1) { > AddColItem(new cOsdItem(tr("- adjust crop values:"))); >- Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 0, M->getWidth())); >- Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 0, M->getHeight())); >+ Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 8, M->getWidth())); >+ Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 8, M->getHeight())); >+ // values are really checked and limited with cMovie class >+ // and depend on CropWidth/Height and Width/Height for the following parameters >+ Add(new cMenuEditIntItem(tr("CropPosX"), &MovOSD.CropPosX, -1, M->getWidth())); >+ Add(new cMenuEditIntItem(tr("CropPosY"), &MovOSD.CropPosY, -1, M->getHeight())); > } > asprintf(&s, tr("- postprocessing Filters(%s):"), M->getPPValues() ? M->getPPValues() : "off"); > AddColItem(new cOsdItem(s)); >@@ -877,19 +965,26 @@ > if (M->getScaleType() == 1 || M->getScaleType() == 3) { > CropWidthsave = M->getCropWidth(); > CropHeightsave = M->getCropHeight(); >+ CropPosXsave = M->getCropPosX(); >+ CropPosYsave = M->getCropPosY(); > } > M->setNumTemplate(MovOSD.Template); > // restore old crop values > if (M->getScaleType() == 1 || M->getScaleType() == 3) { >- M->setCropValues(CropWidthsave, CropHeightsave); >+ M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave); > } > M->saveMovieData(); > Set(); > > #ifdef VDRRIP_DVD > } else if (M->isDVD() && MovOSD.Title != MovOSDsave.Title && MovOSD.Title > 0) { >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("reading audio-data from dvd...")); >+ Skins.Flush(); >+#else > Interface->Status(tr("reading audio-data from dvd...")); > Interface->Flush(); >+#endif > M->setDVDTitle(MovOSD.Title, true); > M->saveMovieData(); > Set(); >@@ -914,7 +1009,7 @@ > > } else if (MovOSD.Container != MovOSDsave.Container) { > if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 && >- strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) { >+ strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) { > // avi couldn't contain ogg-vorbis audio > M->setContainer(MovOSDsave.Container); > } else { >@@ -930,7 +1025,7 @@ > > } else if (MovOSD.ACodec != MovOSDsave.ACodec) { > if (strcmp(M->C->getContainer(MovOSD.Container), "avi") == 0 && >- strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) { >+ strcmp(M->C->getACodec(MovOSD.ACodec), "ogg-vorbis") == 0) { > // avi couldn't contain ogg-vorbis audio > M->setCodecs(MovOSD.VCodec, MovOSDsave.ACodec); > } else { >@@ -949,10 +1044,12 @@ > if (MovOSDsave.ScaleType == 1 || MovOSDsave.ScaleType == 3) { > CropWidthsave = M->getCropWidth(); > CropHeightsave = M->getCropHeight(); >+ CropPosXsave = M->getCropPosX(); >+ CropPosYsave = M->getCropPosY(); > M->setScaleType(MovOSD.ScaleType); > } else { > M->setScaleType(MovOSD.ScaleType); >- M->setCropValues(CropWidthsave, CropHeightsave); >+ M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave); > } > M->saveMovieData(); > Set(); >@@ -971,18 +1068,21 @@ > Set(); > > } else if (MovOSD.CropWidth != MovOSDsave.CropWidth || MovOSD.CropHeight != MovOSDsave.CropHeight) { >- if (MovOSD.CropWidth <= MovOSDsave.CropWidth) { >- MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16); >- } else {MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16) + 16;} >- >- if (MovOSD.CropHeight <= MovOSDsave.CropHeight) { >- MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16); >- } else {MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16) + 16;} >+ if (ABS(MovOSD.CropWidth - MovOSDsave.CropWidth) >+ + ABS(MovOSD.CropHeight - MovOSDsave.CropHeight) == 1) { >+ MovOSD.CropWidth = MovOSDsave.CropWidth + 8*(MovOSD.CropWidth - MovOSDsave.CropWidth); >+ MovOSD.CropHeight = MovOSDsave.CropHeight + 8*(MovOSD.CropHeight - MovOSDsave.CropHeight); >+ } > > M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight); > M->saveMovieData(); > Set(); > >+ } else if (MovOSD.CropPosX != MovOSDsave.CropPosX || MovOSD.CropPosY != MovOSDsave.CropPosY) { >+ M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight, MovOSD.CropPosX, MovOSD.CropPosY); >+ M->saveMovieData(); >+ Set(); >+ > } else if (MovOSD.PPDeinterlace != MovOSDsave.PPDeinterlace || MovOSD.PPDeblock != MovOSDsave.PPDeblock) { > if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 0) M->setPPValues(NULL); > else if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 1) M->setPPValues("hb/vb/dr/al"); >@@ -1033,12 +1133,12 @@ > } > > case kRed: { >- int p; >- Interface->Confirm(tr("<ok> for preview-mode")) ? p = 1 : p = 0; >+ int p; >+ Interface->Confirm(tr("<ok> for preview-mode")) ? p = 1 : p = 0; > if (Interface->Confirm(tr("add movie to encoding queue ?"))) { >- cQueue *Q; >+ cQueue *Q; > struct QueueData *q; >- Q = new cQueue; >+ Q = new cQueue; > q = (struct QueueData*)malloc(sizeof(struct QueueData)); > > q->Dir = M->getDir(); >@@ -1062,63 +1162,84 @@ > q->Rename = VdrripSetup.Rename; > q->Container = M->C->getContainer(M->getContainer()); > q->Preview = p; >+ q->PreviewFileNum = M->getPreviewFileNum(); >+ q->PreviewStartByte = M->getPreviewStartByte(); >+ q->PreviewFrames = M->getPreviewFrames(); >+ q->FileNum = M->getFileNum(); >+ q->StartByte = M->getStartByte(); >+ q->Frames = M->getFrames(); > > if(Q->New(q)) { > FREE(q); > DELETE(Q); > return osBack; >- } else {Interface->Error(tr("the queuefile is locked by the queuehandler !"));} >+ } else { >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !")); >+#else >+ Interface->Error(tr("the queuefile is locked by the queuehandler !")); >+#endif >+ } > > FREE(q); > DELETE(Q); > >- Set(); >+ Set(); > } > break; > } > > case kGreen: { > if (MovOSD.ScaleType == 1 | MovOSD.ScaleType == 3) { >- if (CropReset) { >- if (Interface->Confirm(tr("reset black movie boarders ?"))) { >- CropReset = false; >- M->initCropValues(); >- M->setScale(); >- M->saveMovieData(); >- } >- } else { >- if (Interface->Confirm(tr("crop black movie boarders ?"))) { >- CropReset = true; >+ if (CropReset) { >+ if (Interface->Confirm(tr("reset black movie boarders ?"))) { >+ CropReset = false; >+ M->initCropValues(); >+ M->setScale(); >+ M->saveMovieData(); >+ } >+ } else { >+ if (Interface->Confirm(tr("crop black movie boarders ?"))) { >+ CropReset = true; >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("search for black movie boarders")); >+ Skins.Flush(); >+#else > Interface->Status(tr("search for black movie boarders")); >- Interface->Flush(); >+ Interface->Flush(); >+#endif > if (! M->setCropValues()) { >- CropReset = false; >- Interface->Error(tr("couldn't detect black movie boarders !")); >- } >- M->saveMovieData(); >+ CropReset = false; >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, tr("couldn't detect black movie boarders !")); >+#else >+ Interface->Error(tr("couldn't detect black movie boarders !")); >+#endif >+ } >+ M->saveMovieData(); > } >- } >- Set(); >+ } >+ Set(); > } > break; > } > > case kYellow: { > Expert ? Expert = false : Expert = true; >- Set(); >+ Set(); > break; > } > > case kOk: { >- const char *l = Get(Current())->Text(); >- if (strstr(l, tr("Audio-Str."))) { >- AddSubMenu(new cMenuVdrripMovieAudio(M)); >+ const char *l = Get(Current())->Text(); >+ if (strstr(l, tr("Audio-Str."))) { >+ AddSubMenu(new cMenuVdrripMovieAudio(M)); > #ifdef VDRRIP_DVD >- } else if (strstr(l, tr("Title*"))) { >- AddSubMenu(new cMenuVdrripMovieTitles(M)); >+ } else if (strstr(l, tr("Title*"))) { >+ AddSubMenu(new cMenuVdrripMovieTitles(M)); > #endif //VDRRIP_DVD >- } >- break; >+ } >+ break; > } > > default: >@@ -1133,11 +1254,13 @@ > } > > void cMenuVdrripMovie::AddColItem(cOsdItem *i) { >+#if VDRVERSNUM < 10307 > #ifdef clrScrolLine > i->SetColor(clrScrolLine, clrBackground); > #else > i->SetColor(clrCyan, clrBackground); > #endif >+#endif > > Add(i); > } >@@ -1163,8 +1286,13 @@ > eOSState state = cOsdMenu::ProcessKey(Key); > > if (Key == kOk) { >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtStatus, tr("reading audio-data from dvd...")); >+ Skins.Flush(); >+#else > Interface->Status(tr("reading audio-data from dvd...")); > Interface->Flush(); >+#endif > M->setDVDTitle(Current() + 1, true); > M->saveMovieData(); > return osBack; >@@ -1212,6 +1340,7 @@ > MinScaleWidth = 480; > CropMode = 0; > CropLength = 5; >+ PreviewLength = 60; > Rename = 0; > OggVorbis = 0; > AC3 = 0; >@@ -1225,6 +1354,7 @@ > else if (!strcasecmp(Name, "MinScaleWidth")) MinScaleWidth = atoi(Value); > else if (!strcasecmp(Name, "CropMode")) CropMode = atoi(Value); > else if (!strcasecmp(Name, "CropLength")) CropLength = atoi(Value); >+ else if (!strcasecmp(Name, "PreviewLength")) PreviewLength = atoi(Value); > else if (!strcasecmp(Name, "Rename")) Rename = atoi(Value); > else if (!strcasecmp(Name, "OggVorbis")) OggVorbis = atoi(Value); > else if (!strcasecmp(Name, "AC3")) AC3 = atoi(Value); >@@ -1246,6 +1376,7 @@ > Add(new cMenuEditIntItem(tr("MinScaleWidth"), &data.MinScaleWidth, 1, 9999)); > Add(new cMenuEditStraItem(tr("Crop Mode"), &data.CropMode, 2, CropModes)); > Add(new cMenuEditIntItem(tr("Crop DetectLength (s)"), &data.CropLength, 1, 999)); >+ Add(new cMenuEditIntItem(tr("PreviewLength (s)"), &data.PreviewLength, 1, 9999)); > Add(new cMenuEditBoolItem(tr("Rename movie after encoding"), &data.Rename, tr("no"), tr("yes"))); > Add(new cMenuEditBoolItem(tr("Ogg-Vorbis support"), &data.OggVorbis, tr("no"), tr("yes"))); > Add(new cMenuEditBoolItem(tr("AC3 support (MPlayer-patch inst.)"), &data.AC3, tr("no"), tr("yes"))); >@@ -1267,6 +1398,7 @@ > SetupStore("MinScaleWidth", VdrripSetup.MinScaleWidth); > SetupStore("CropMode", VdrripSetup.CropMode); > SetupStore("CropLength", VdrripSetup.CropLength); >+ SetupStore("PreviewLength", VdrripSetup.PreviewLength); > SetupStore("Rename", VdrripSetup.Rename); > SetupStore("OggVorbis", VdrripSetup.OggVorbis); > SetupStore("AC3", VdrripSetup.AC3); >diff -ur vdrrip-0.3.0/menu-vdrrip.h vdrrip-0.3.0-new/menu-vdrrip.h >--- vdrrip-0.3.0/menu-vdrrip.h 2004-04-22 19:40:25.000000000 +0200 >+++ vdrrip-0.3.0-new/menu-vdrrip.h 2007-09-28 21:49:47.000000000 +0200 >@@ -7,6 +7,10 @@ > > #include <vdr/osd.h> > #include <vdr/menuitems.h> >+#if VDRVERSNUM >= 10307 >+#include <vdr/menu.h> >+#include <vdr/skins.h> >+#endif > > #include "movie.h" > #include "vdrriprecordings.h" >@@ -35,6 +39,8 @@ > //expert menu: > int CropWidth; > int CropHeight; >+ int CropPosX; >+ int CropPosY; > int PPDeinterlace; > int PPDeblock; > int Bpp; >@@ -51,7 +57,12 @@ > > #ifdef VDRRIP_DVD > >-class cMenuVdrripWarning : public cOsdMenu { >+class cMenuVdrripWarning >+#if VDRVERSNUM >= 10307 >+ : public cMenuText { >+#else >+ : public cOsdMenu { >+#endif > private: > bool hadsubmenu; > >@@ -140,12 +151,15 @@ > char *FileSize[1]; > char *MovieData[1]; > char *CropData[1]; >+ char *RangeData[1]; > char *ScaleData[1]; > > bool OSDupdate, Crop, CropReset, Expert; > > int CropWidthsave; > int CropHeightsave; >+ int CropPosXsave; >+ int CropPosYsave; > > int NumStatic; > >@@ -182,6 +196,7 @@ > int MinScaleWidth; > int CropMode; > int CropLength; >+ int PreviewLength; > int Rename; > int OggVorbis; > int AC3; >diff -ur vdrrip-0.3.0/movie.c vdrrip-0.3.0-new/movie.c >--- vdrrip-0.3.0/movie.c 2004-04-21 18:47:10.000000000 +0200 >+++ vdrrip-0.3.0-new/movie.c 2007-09-29 05:22:01.000000000 +0200 >@@ -6,12 +6,16 @@ > #include <stdlib.h> > #include <string.h> > #include <math.h> >+#include <sys/types.h> >+#include <sys/stat.h> >+#include <unistd.h> > > #ifdef VDRRIP_DVD > #include <dvdnav/ifo_read.h> > #endif //VDRRIP_DVD > > #include <vdr/plugin.h> >+#include <vdr/recording.h> > > #include "movie.h" > #include "menu-vdrrip.h" >@@ -21,10 +25,14 @@ > > #define SAVEFILE "save.vdrrip" > >-#define IDENTCMD "%s \'%s\'%s -identify -frames 0 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'" >-#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" >-#define AUDIOCMD "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO" >-#define AUDIOCMDDVD "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO" >+#define DVDIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'" >+#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" >+#define DVDAUDIO "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO" >+ >+#define VDRIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'" >+#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" >+#define VDRAUDIO "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO" >+ > #define MENCCMD "%s %s help 2>/dev/null" > > // --- cMovie ------------------------------------------------------------ >@@ -38,7 +46,7 @@ > StrTitles = NULL; > #endif //VDRRIP_DVD > >- Dir = OrigName = Name = PPValues = NULL; >+ Dir = Marks = Name = OrigName = PPValues = NULL; > A = NULL; > StrAudioData = StrAudioData2 = NULL; > >@@ -75,9 +83,10 @@ > Dvd = false; > > // detect vdr-data >- setLengthVDR(); > queryMpValuesVDR(); > queryAudioDataVDR(); >+ setLengthVDR(); >+ setMarksVDR(); > > if (! restoreMovieData()) { > // set to default template >@@ -167,8 +176,9 @@ > int cMovie::getFileNumbers() {return FileNumbers;} > > void cMovie::setBitrate(int v, int a) { >- // avoid BitrateAudio < 32 >- if (a < 32 && strcmp(C->getACodec(ACodec), "copy") != 0) {a = 32;} >+ // set audio bitrates and avoid BitrateAudio < 32 >+ if (ACodec == C->getNumACodec("copy")) { a = A[AudioID].Bitrate; } >+ else { if (a < 32) {a = 32;} } > BitrateAudio = a; > > if (v == -1) { >@@ -182,13 +192,13 @@ > > // avoid BitrateVideo < 150 > if (Bitrate <= BitrateAudio + 150) { >- Bitrate = BitrateAudio + 150; >+ Bitrate = BitrateAudio + 150; > setFileSize(-1, FileNumbers); > } > > // avoid BitrateVideo > 99999 > if (Bitrate > BitrateAudio + 99999) { >- Bitrate = BitrateAudio + 99999; >+ Bitrate = BitrateAudio + 99999; > setFileSize(-1, FileNumbers); > } > >@@ -259,7 +269,21 @@ > ScaleHeight = height; > } > >+void cMovie::setCropValues(int width, int height, int posx, int posy) { >+ setCropValues(width, height); >+ >+ if (posx > Width - CropWidth) { CropPosX = Width - CropWidth; } >+ else if (posx < 0) { CropPosX = 0; } >+ else { CropPosX = posx; } >+ >+ if (posy > Height - CropHeight) { CropPosY = Height - CropHeight; } >+ else if (posy < 0) { CropPosY = 0; } >+ else { CropPosY = posy; } >+} >+ > void cMovie::setCropValues(int width, int height) { >+ CalcAspect = Aspect; >+ > CropWidth = width; > if (CropWidth > Width) CropWidth = Width; > >@@ -267,14 +291,15 @@ > if (CropHeight > Height) CropHeight = Height; > > if (CropWidth == -1) CropPosX = -1; >- else CropPosX = (Width - CropWidth) / 2; >+ else { >+ CropPosX = (Width - CropWidth) / 2; >+ CalcAspect = CropWidth * CalcAspect / Width; >+ } > >- if (CropHeight == -1) { >- CropPosY = -1; >- CalcAspect = Aspect; >- } else { >+ if (CropHeight == -1) {CropPosY = -1;} >+ else { > CropPosY = (Height - CropHeight) / 2; >- CalcAspect = Height * Aspect / CropHeight; >+ CalcAspect = Height * CalcAspect / CropHeight; > } > > setScale(); >@@ -285,72 +310,94 @@ > char *cmd = NULL, *buf = NULL; > bool ret = true; > >- size_t i = 0; >- int l = 0; >- int l1; >+ off_t skipbytes = 0; >+ int skipseconds = 0; >+ int frames_to_inspect; > >- if (Dvd) {asprintf(&cmd, IDENTCMD, MPlayer, Dir, ""); >- } else {asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr");} >+ FILE *p = NULL; > >- FILE *p = popen(cmd, "r"); >- if (p) { >- char *s = NULL; >- s = strcol(strgrep("ID_LENGTH", p), "=", 2); >- if (s) {l = atoi(s);} >- FREE(s); >+ if (Dvd) { >+ asprintf(&cmd, DVDIDENT, MPlayer, Dir, ""); >+ >+ p = popen(cmd, "r"); >+ if (p) { >+ char *s = NULL; >+ s = strcol(strgrep("ID_LENGTH", p), "=", 2); >+ if (s) {skipseconds = atoi(s)/2;} >+ FREE(s); >+ } else { >+ dsyslog("[vdrrip] could not open pipe to %s !", cmd); >+ } >+ pclose(p); >+ FREE(cmd); > } else { >- dsyslog("[vdrrip] could not open pipe to %s !", cmd); >- } >- pclose(p); >- FREE(cmd); >+ asprintf(&cmd, "%s%s", Dir, "/001.vdr"); //lazy and safe strcat >+ >+ /* skip to the middle of 001.vdr - there are cases where -ss option of >+ * mplayer does not work to seek a vdr file, so use -sb instead >+ */ >+ struct stat *vdrstat = (struct stat *) malloc(sizeof(struct stat)); >+ if (0 == stat(cmd, vdrstat)) { >+ skipbytes = (vdrstat->st_size) >> 1; // divide filesize by 2 >+ } else { >+ dsyslog("[vdrrip] could not stat %s to determine filesize!", cmd); >+ } > >+ FREE(vdrstat); >+ FREE(cmd); >+ } > >- l1 = VdrripSetup.CropLength * (int)Fps; >+ frames_to_inspect = VdrripSetup.CropLength * (int)Fps; > if (Dvd) { >- asprintf(&cmd, CROPCMD, MPlayer, Dir, "", l/2, l1); >+ asprintf(&cmd, DVDCROP, MPlayer, Dir, "", skipseconds, frames_to_inspect); > isyslog("[vdrrip] detecting crop values in %s", Dir); > } else { >- asprintf(&cmd, CROPCMD, MPlayer, Dir, "/001.vdr", l/2, l1); >+ asprintf(&cmd, VDRCROP, MPlayer, Dir, "/001.vdr", (long long) skipbytes, frames_to_inspect); > isyslog("[vdrrip] detecting crop values in %s/001.vdr", Dir); >+ isyslog("[vdrrip] mplayer command used: %s", cmd); > } > p = popen(cmd, "r"); > FREE(cmd); > > if (p) { >- // get first line >+ /* get first line only - shows most occurences of identically detected crop parameters >+ * within frames_to_inspect starting from skipseconds/skipbytes >+ */ >+ size_t i; > if (getline(&buf, &i, p) != -1) { > char *s = NULL; > > s = strcol(buf, "=", 2); >- CropWidth = roundValue(atoi(strcol(s, ":", 1)), 16); >- if (CropWidth > Width || CropWidth < 0) { >- ret = false; >- CropWidth = Width; >- } >- >- CropHeight = roundValue(atoi(strcol(s, ":", 2)), 16); >- if (CropHeight > Height || CropHeight < 0) { >- ret = false; >- CropHeight = Height; >+ CropHeight = atoi(strcol(s, ":", 2)); >+ CropPosY = atoi(strcol(s, ":", 4)); >+ if (CropHeight > Height || CropHeight < 8) {ret = false;} >+ if (CropPosY > Height - CropHeight || CropPosY < 0) {ret = false;} >+ >+ // crop width only if desired >+ if (VdrripSetup.CropMode == 1) { >+ CropWidth = Width; >+ CropPosX = 0; >+ } else { >+ CropWidth = atoi(strcol(s, ":", 1)); >+ CropPosX = atoi(strcol(s, ":", 3)); >+ if (CropWidth > Width || CropWidth < 8) {ret = false;} >+ if (CropPosX > Width - CropWidth || CropPosX < 0) {ret = false;} > } > >- if (VdrripSetup.CropMode == 1) {CropWidth = Width;} >- CropPosX = (Width - CropWidth) / 2; >- CropPosY = (Height - CropHeight) / 2; >- // CalcAspect is changed now: >- CalcAspect = Height * Aspect / CropHeight; >- setScale(); >+ // CalcAspect is changed now >+ if (ret) { >+ CalcAspect = Height * Aspect / CropHeight; >+ setScale(); >+ } > > FREE(s); > FREE(buf); >- } else { >- ret = false; > } > >- pclose(p); >- } else ret = false; >+ pclose(p); >+ } > >- if (! ret) initCropValues(); >+ if (!ret) initCropValues(); > > return ret; > } >@@ -363,6 +410,14 @@ > CalcAspect = Aspect; > } > >+int cMovie::getPreviewFileNum() { return PreviewFileNum; } >+int cMovie::getPreviewStartByte() { return PreviewStartByte; } >+int cMovie::getPreviewFrames() { return PreviewFrames; } >+int cMovie::getFileNum() { return FileNum; } >+int cMovie::getStartByte() { return StartByte; } >+int cMovie::getFrames() { return Frames; } >+char *cMovie::getMarks() { return Marks; } >+ > void cMovie::setCodecs(int v, int a) { > // validate video codec > if (v >= 0 && v < C->getNumVCodecs()) {VCodec = v; >@@ -374,7 +429,7 @@ > // validate audio codec > if (a >= 0 && a < C->getNumACodecs()) { > if (strcmp(C->getContainer(Container), "avi") == 0 && >- strcmp(C->getACodec(a), "ogg-vorbis") == 0) { >+ strcmp(C->getACodec(a), "ogg-vorbis") == 0) { > dsyslog("[vdrrip] avi couldn't contain ogg-vorbis audio, falling back to copy !"); > ACodec = C->getNumACodec("copy"); > } else {ACodec = a;} >@@ -383,12 +438,8 @@ > ACodec = C->getNumACodec("copy"); > } > >- // set audio bitrates >- if (ACodec == C->getNumACodec("copy")) { >- setBitrate(T->getBitrateVideo(NumTemplate), A[AudioID].Bitrate); >- } else { >- setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate)); >- } >+ // set bitrates >+ setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate)); > } > > void cMovie::setBpp(int i) { >@@ -429,7 +480,8 @@ > int cMovie::getCropPosY() {return CropPosY;} > > double cMovie::getResBpp() { >- return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps;} >+ return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps; >+} > > double cMovie::getBpp() {return (double)Bpp;} > >@@ -491,10 +543,92 @@ > } > > >+bool cMovie::getByteOffset(int frameindex, int *filenum, int *byteoff) { >+ bool ret = false; >+ uchar tmp = 1; >+ >+ cIndexFile *vdrindex = new cIndexFile(Dir, false); >+ if (vdrindex->Ok()) { >+ if (vdrindex->Get(frameindex, &tmp, byteoff)) { ret = true; } >+ } >+ *filenum = (int) tmp; >+ >+ return ret; >+} >+ >+ >+void cMovie::setMarksVDR() { >+ EndFrame = Frames = StartFrame = StartByte = -1; >+ cMarks *vdrmarks = new cMarks(); >+ vdrmarks->Load(Dir); >+ >+ if (vdrmarks->GetNext(StartByte)) StartFrame = vdrmarks->GetNext(0)->position; >+ if (vdrmarks->GetNext(StartByte)) EndFrame = vdrmarks->GetNext(StartFrame)->position; >+ FREE(vdrmarks); >+ >+ /* rewritten by this function on success, stays NULLified on failure */ >+ FREE(Marks); >+ Marks = NULL; >+ >+ /* Start marker was set, start encoding at this position (unless index is corrupt) */ >+ if (StartFrame > -1) { >+ >+ /* If the index is not OK, we cannot determine start position.. >+ * discard the start marker, beginning will be used.. */ >+ if (!getByteOffset(StartFrame, &FileNum, &StartByte)) { >+ FileNum = 1; >+ StartFrame = StartByte = -1; /* keep StartFrame only if StartByte was calculated */ >+ isyslog("[vdrrip] can't convert start marker to start byte, index in %s is not ok!", Dir); >+ } >+ >+ /* End marker was set, stop encoding after Frames frames */ >+ if (EndFrame > -1) { >+ if (StartFrame > -1) { >+ Frames = EndFrame - StartFrame + 1; >+ asprintf(&Marks, "%s - %s", >+ (const char*) IndexToHMSF(StartFrame, true), >+ (const char*) IndexToHMSF(EndFrame, true) >+ ); >+ } >+ else { >+ Frames = EndFrame; >+ asprintf(&Marks, "0:00:00.00 - %s", (const char*) IndexToHMSF(EndFrame, true)); >+ } >+ >+ /* Update Length for Bitrate, Filesize computation.. */ >+ Length = (int) (Frames / Fps); >+ } else { >+ if (StartFrame > -1) { >+ /* EOF == (const char*) IndexToHMSF(StartFrame + Length * Fps, true) */ >+ asprintf(&Marks, "%s - EOF", (const char*) IndexToHMSF(StartFrame, true)); >+ >+ /* Update Length for Bitrate, Filesize computation.. */ >+ Length -= (int) (StartFrame / Fps); >+ } >+ } >+ >+ } /* StartFrame > -1 */ >+ >+ if (Marks) { isyslog("[vdrrip] using markers, encoding %s..", Marks); } >+ >+ /* calculate related stuff (preview), make sure setMarksVDR is called to set these.. */ >+ int PreviewStartFrame = (int) ((((Frames>-1) ? (Frames) : (Length*Fps)) - getPreviewFrames()) / 2 >+ + ((StartFrame>-1) ? (StartFrame) : (0))); >+ if(!getByteOffset(PreviewStartFrame, &PreviewFileNum, &PreviewStartByte)) { >+ PreviewFileNum = 1; >+ PreviewStartByte = -1; >+ } >+ >+ PreviewFrames = VdrripSetup.PreviewLength; >+ if (PreviewFrames > Length) { PreviewFrames = Length / 2; } >+ PreviewFrames = (int) (PreviewFrames * Fps); >+} >+ >+ > void cMovie::queryMpValuesVDR() { > char *cmd = NULL, *s = NULL; > >- asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr"); >+ asprintf(&cmd, VDRIDENT, MPlayer, Dir, "/001.vdr"); > FILE *p = popen(cmd, "r"); > if (p) { > s = strcol(strgrep("ID_VIDEO_WIDTH", p), "=", 2); >@@ -515,11 +649,12 @@ > } else {Fps = -1;} > FREE(s); > >- s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2); >- if (s) { >- Aspect = atof(s); >- } else {Aspect = -1;} >- >+ Aspect = -1; >+ while(s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2)){ >+ Aspect = atof(s); >+ if (Aspect != 0) break; >+ } >+ if (Aspect == 0) {Aspect = 1.333333;} > CalcAspect = Aspect; > > pclose(p); >@@ -538,43 +673,43 @@ > bool next = true; > > while (next) { >- asprintf(&cmd, AUDIOCMD, MPlayer, Dir, c); >+ asprintf(&cmd, VDRAUDIO, MPlayer, Dir, c); > FILE *p = popen(cmd, "r"); > if (p) { > if (getline(&buf, &i, p) != -1) { >- if (c == 128) {next = false;} >- A = (struct AudioData*)realloc(A, (n + 1) * sizeof(struct AudioData)); >+ if (c == 128) {next = false;} >+ A = (struct AudioData*)realloc(A, (n + 1) * sizeof(struct AudioData)); > >- A[n].AudioID = c; >- A[n].Lang = strdup(tr("unknown")); >+ A[n].AudioID = c; >+ A[n].Lang = strdup(tr("unknown")); > >- if (c == 128) {A[n].Format = strdup("ac3"); >- } else {A[n].Format = strdup("mp2");} >+ if (c == 128) {A[n].Format = strdup("ac3"); >+ } else {A[n].Format = strdup("mp2");} > >- char *s = NULL; >+ char *s = NULL; > s = strcol(buf, " ", 2); >- if (s) {A[n].Freq = atoi(s); >- } else {A[n].Freq = 0;} >- FREE(s); >+ if (s) {A[n].Freq = atoi(s); >+ } else {A[n].Freq = 0;} >+ FREE(s); > > s = strcol(buf, " ", 4); >- if (s) {A[n].Chan = atoi(s); >- } else {A[n].Chan = 0;} >- FREE(s); >+ if (s) {A[n].Chan = atoi(s); >+ } else {A[n].Chan = 0;} >+ FREE(s); > > s = strcol(buf, " ", 11); >- if (s) { >- A[n].Bitrate = atoi(s + sizeof(char)); >- } else {A[n].Bitrate = 192;} >+ if (s) { >+ A[n].Bitrate = atoi(s + sizeof(char)); >+ } else {A[n].Bitrate = 192;} > FREE(s); >- >- // 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); >+ >+ // 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); > n++; >- c++; >+ c++; > } else { >- // nothing found: >- if (c < 128 && VdrripSetup.AC3 == 1) {c = 128; >- } else {next = false;} >+ // nothing found: >+ if (c < 128 && VdrripSetup.AC3 == 1) {c = 128; >+ } else {next = false;} > } > pclose(p); > } else {dsyslog("[vdrrip] could not open pipe to %s !", cmd);} >@@ -661,12 +796,12 @@ > FILE *f = fopen(file,"r"); > if (f) { > if (getline(&buf, &i, f) != -1) { >+ fclose(f); >+ > Name = strcol(buf, ";", 1); > FileSize = atoi(strcol(buf, ";", 2)); > FileNumbers = atoi(strcol(buf, ";", 3)); >- Bitrate = atoi( strcol(buf, ";", 4)); > vcodec = strcol(buf, ";", 5); >- BitrateVideo = atoi(strcol(buf, ";", 6)); > CropWidth = atoi(strcol(buf, ";", 7)); > CropHeight = atoi(strcol(buf, ";", 8)); > CropPosX = atoi(strcol(buf, ";", 9)); >@@ -676,7 +811,6 @@ > ScaleHeight = atoi(strcol(buf, ";", 13)); > Bpp = atoi(strcol(buf, ";", 14)); > acodec = strcol(buf, ";", 15); >- BitrateAudio = atoi(strcol(buf, ";", 16)); > AudioID = atoi(strcol(buf, ";", 17)); > PPValues = strcol(buf, ";", 18); > if (strcmp(PPValues, "(null)") == 0) PPValues = NULL; >@@ -689,18 +823,13 @@ > if (Dvd) Title = atoi(strcol(buf, ";", 21)); > #endif //VDRRIP_DVD > >- FREE(buf); >- >- fclose(f); >- isyslog("[vdrrip] restored data from file %s !", file); >- > // validate some values: >- if (! Dvd) setCropValues(CropWidth, CropHeight); >+ if (! Dvd) setCropValues(CropWidth, CropHeight, CropPosX, CropPosY); > > NumTemplate = T->getNumTemplate(tname); > if (NumTemplate == -1) { > dsyslog("[vdrrip] %s is not a valid template, falling back to default !", tname); >- NumTemplate = T->getNumTemplate(TDEFAULT); >+ NumTemplate = T->getNumTemplate(TDEFAULT); > } > FREE(tname); > >@@ -716,7 +845,11 @@ > FREE(acodec); > > setAudioID(AudioID); >+ setBitrate(atoi(strcol(buf, ";", 6)), atoi(strcol(buf, ";", 16))); >+ setMarksVDR(); > >+ isyslog("[vdrrip] restored data from file %s !", file); >+ FREE(buf); > } else { > dsyslog("[vdrrip] could not read data from file %s !", file); > FREE(file); >@@ -747,13 +880,13 @@ > if (! fseek(f, 32808, SEEK_SET )) { > i = fread(name, 1, 32, f); > if (i == 32) { >- name[32] = '\0'; >+ name[32] = '\0'; > while(i-- > 2) {if (name[i] == ' ') name[i] = '\0';} > Name = strdup(name); >- OrigName = strdup(name); >+ OrigName = strdup(name); > } else { >- dsyslog("[vdrrip] Couldn't read enough bytes for title !"); >- Name = strdup(tr("unknown")); >+ dsyslog("[vdrrip] Couldn't read enough bytes for title !"); >+ Name = strdup(tr("unknown")); > } > } else { > dsyslog("[vdrrip] Couldn't seek in %s for title", DVD); >@@ -828,23 +961,23 @@ > > if (ifo[numifo]->vtsi_mat) { > vtsi_mat = ifo[numifo]->vtsi_mat; >- vts_pgcit = ifo[numifo]->vts_pgcit; >- video_attr = &vtsi_mat->vts_video_attr; >- vts_ttn = ifo_zero->tt_srpt->title[i].vts_ttn; >- vmgi_mat = ifo_zero->vmgi_mat; >- pgc = vts_pgcit->pgci_srp[ifo[numifo]->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc; >- dt = &pgc->playback_time; >- >+ vts_pgcit = ifo[numifo]->vts_pgcit; >+ video_attr = &vtsi_mat->vts_video_attr; >+ vts_ttn = ifo_zero->tt_srpt->title[i].vts_ttn; >+ vmgi_mat = ifo_zero->vmgi_mat; >+ pgc = vts_pgcit->pgci_srp[ifo[numifo]->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc; >+ dt = &pgc->playback_time; >+ > // read the movie-data of the title into the struc DVDData: >- D[i].Length = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600; >- D[i].Length += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60; >- D[i].Length += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)); >- if (D[i].Length == 0) {D[i].Length = -1;} >- >- D[i].Width = width[video_attr->picture_size]; >- D[i].Height = height[video_attr->video_format]; >- D[i].Aspect = aspect[video_attr->display_aspect_ratio]; >- D[i].Fps = fps[(pgc->playback_time.frame_u & 0xc0) >> 6]; >+ D[i].Length = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600; >+ D[i].Length += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60; >+ D[i].Length += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)); >+ if (D[i].Length == 0) {D[i].Length = -1;} >+ >+ D[i].Width = width[video_attr->picture_size]; >+ D[i].Height = height[video_attr->video_format]; >+ D[i].Aspect = aspect[video_attr->display_aspect_ratio]; >+ D[i].Fps = fps[(pgc->playback_time.frame_u & 0xc0) >> 6]; > > D[i].NumAudio = vtsi_mat->nr_of_vts_audio_streams; > // reserve memory for DVDAudioData >@@ -856,24 +989,24 @@ > asprintf(&D[i].A[i1].Lang, "%c%c", audio_attr->lang_code >> 8, audio_attr -> lang_code & 0xff); > D[i].A[i1].Format = strdup(audio_format[audio_attr->audio_format]); > D[i].A[i1].Freq = atoi(sample_freq[audio_attr->sample_frequency]); >- D[i].A[i1].Chan = audio_attr->channels+1; >- D[i].A[i1].AudioID = 128 + i1; >- D[i].A[i1].Bitrate = -1; >+ D[i].A[i1].Chan = audio_attr->channels+1; >+ D[i].A[i1].AudioID = 128 + i1; >+ D[i].A[i1].Bitrate = -1; > } >- >+ > // save number of the longest Title > if (D[i].Length > l) { > l = D[i].Length; > Title = i + 1; >- LongestTitle = Title; >+ LongestTitle = Title; > } >- } >+ } > } > > // close ifos > ifoClose(ifo_zero); > for (i = 1; i <= numifos; i++) { >- if(ifo[i]) ifoClose(ifo[i]); >+ if(ifo[i]) ifoClose(ifo[i]); > } > FREE(ifo); > >@@ -951,13 +1084,13 @@ > size_t i = 0; > int b = 0; > >- asprintf(&cmd, AUDIOCMDDVD, MPlayer, Dir, c); >+ asprintf(&cmd, DVDAUDIO, MPlayer, Dir, c); > FILE *p = popen(cmd, "r"); > if (p) { > if (getline(&buf, &i, p) != -1) { > char *s = strcol(buf, " ", 11); > if (s) { >- b = atoi(s + sizeof(char)); >+ b = atoi(s + sizeof(char)); > FREE(s); > } > } >diff -ur vdrrip-0.3.0/movie.h vdrrip-0.3.0-new/movie.h >--- vdrrip-0.3.0/movie.h 2004-04-21 18:34:19.000000000 +0200 >+++ vdrrip-0.3.0-new/movie.h 2007-09-29 03:19:01.000000000 +0200 >@@ -37,11 +37,15 @@ > > > class cMovie { >+ private: >+ bool getByteOffset(int frameindex, int *filenum, int *byteoff); >+ > protected: > bool Dvd; > > char *OrigName; > char *Name; >+ char *Marks; > char *Dir; > int Length; > int FileSize; >@@ -62,6 +66,14 @@ > int CropHeight; > int CropPosX; > int CropPosY; >+ int StartFrame; >+ int EndFrame; >+ int PreviewFileNum; >+ int PreviewStartByte; >+ int PreviewFrames; >+ int FileNum; >+ int StartByte; >+ int Frames; > int Bpp; > int Container; > int VCodec; >@@ -71,7 +83,6 @@ > struct AudioData *A; > char *PPValues; > >- char *MarksFile; > char **StrAudioData; > char **StrAudioData2; > >@@ -116,12 +127,20 @@ > int getScaleType(); > int getScaleWidth(); > int getScaleHeight(); >+ void setCropValues(int width, int height, int posx, int posy); > void setCropValues(int width, int height); > bool setCropValues(); > int getCropHeight(); > int getCropWidth(); > int getCropPosX(); > int getCropPosY(); >+ int getPreviewFileNum(); >+ int getPreviewStartByte(); >+ int getPreviewFrames(); >+ int getFileNum(); >+ int getStartByte(); >+ int getFrames(); >+ char* getMarks(); > void setBpp(int i); > double getBpp(); > double getResBpp(); >@@ -142,6 +161,7 @@ > > // VDR-Movie > void setLengthVDR(); >+ void setMarksVDR(); > void queryMpValuesVDR(); > void queryAudioDataVDR(); > >diff -ur vdrrip-0.3.0/queue.c vdrrip-0.3.0-new/queue.c >--- vdrrip-0.3.0/queue.c 2004-04-18 17:01:05.000000000 +0200 >+++ vdrrip-0.3.0-new/queue.c 2007-09-29 04:26:10.000000000 +0200 >@@ -23,7 +23,7 @@ > } > > void cQueue::Load() { >- char *buf = NULL; >+ char *buf = NULL, *tmp = NULL; > size_t i = 0; > int c = 0; > >@@ -53,11 +53,33 @@ > Q[c].PPValues = strcol(buf, ";", 18); > Q[c].Rename = atoi(strcol(buf, ";", 19)); > // migrate from version 0.1.1 >- char *cont = strcol(buf, ";", 20); >- cont ? Q[c].Container = cont : Q[c].Container = strdup("avi"); >+ tmp = strcol(buf, ";", 20); >+ Q[c].Container = (tmp) ? tmp : strdup("avi"); >+ if (tmp != Q[c].Container) { FREE(tmp); } > // migrate from version 0.2.0a >- char *prev = strcol(buf, ";", 21); >- prev ? Q[c].Preview = atoi(prev) : Q[c].Preview = 0; >+ tmp = strcol(buf, ";", 21); >+ Q[c].Preview = (tmp) ? atoi(tmp) : 0; >+ FREE(tmp); >+ // migrate from version 0.3.0 >+ tmp = strcol(buf, ";", 22); >+ Q[c].PreviewFileNum = (tmp) ? atoi(tmp) : 1; >+ FREE(tmp); >+ tmp = strcol(buf, ";", 23); >+ Q[c].PreviewStartByte = (tmp) ? atoi(tmp) : -1; >+ FREE(tmp); >+ tmp = strcol(buf, ";", 24); >+ Q[c].PreviewFrames = (tmp) ? atoi(tmp) : -1; >+ FREE(tmp); >+ >+ tmp = strcol(buf, ";", 25); >+ Q[c].FileNum = (tmp) ? atoi(tmp) : 1; >+ FREE(tmp); >+ tmp = strcol(buf, ";", 26); >+ Q[c].StartByte = (tmp) ? atoi(tmp) : -1; >+ FREE(tmp); >+ tmp = strcol(buf, ";", 27); >+ Q[c].Frames = (tmp) ? atoi(tmp) : -1; >+ FREE(tmp); > > FREE(buf); > c++; >@@ -84,13 +106,15 @@ > if (q) { > for (c = 0; c < NumMovies; c++) { > if (strcmp(Q[c].Name, "delete") != 0) { >- fprintf(q,"%s;%s;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%i;%s;%i\n", >+ 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", > Q[c].Dir, Q[c].Name, Q[c].FileSize, Q[c].FileNumbers, Q[c].VCodec, > Q[c].BitrateVideo, Q[c].MinQuant, Q[c].MaxQuant, Q[c].CropWidth, > Q[c].CropHeight, Q[c].CropPosX, Q[c].CropPosY, Q[c].ScaleWidth, > Q[c].ScaleHeight, Q[c].ACodec, Q[c].BitrateAudio, Q[c].AudioID, >- Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview); >- n++; >+ Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview, >+ Q[c].PreviewFileNum, Q[c].PreviewStartByte, Q[c].PreviewFrames, >+ Q[c].FileNum, Q[c].StartByte, Q[c].Frames); >+ n++; > } > } > NumMovies = n; >@@ -244,15 +268,15 @@ > // check if the content of the lockfile 0 > int c = fgetc(l); > if (c == 48) { >- loop = false; >- Locked = false; >- break; >+ loop = false; >+ Locked = false; >+ break; > } > > i++; > if (i > 2) { >- loop = false; >- Locked = true; >+ loop = false; >+ Locked = true; > } > isyslog("[vdrrip] %d. try: queuefile is locked by another process", i); > sleep(1); >diff -ur vdrrip-0.3.0/queue.h vdrrip-0.3.0-new/queue.h >--- vdrrip-0.3.0/queue.h 2004-03-17 20:15:44.000000000 +0100 >+++ vdrrip-0.3.0-new/queue.h 2007-09-29 01:32:21.000000000 +0200 >@@ -31,6 +31,12 @@ > int Rename; > char *Container; > int Preview; >+ int PreviewFileNum; >+ int PreviewStartByte; >+ int PreviewFrames; >+ int FileNum; >+ int StartByte; >+ int Frames; > }; > > class cQueue { >diff -ur vdrrip-0.3.0/scripts/queuehandler.sh vdrrip-0.3.0-new/scripts/queuehandler.sh >--- vdrrip-0.3.0/scripts/queuehandler.sh 2004-04-22 20:54:13.000000000 +0200 >+++ vdrrip-0.3.0-new/scripts/queuehandler.sh 2007-09-29 05:15:24.000000000 +0200 >@@ -61,9 +61,14 @@ > # 26.03.2004: 0.3.0: - added evecho function # > # - added $mencoder_ac3 & $mplayer_ac3 # > # - added $qh_ver & qh_conf_ver # >+# 23.04.2004: 0.3.1: - change to -dvd if the mencoder-version # >+# is 0.XX (thx to micmac@www.vdrportal.de) # >+# 23.09.2007: 0.3.2: - sync to updated mplayer cmdline options # >+# -vop => -vf and filters are not applied # >+# in reverse order anymore # > # # > ################################################################# >-qh_ver="0.3.0" >+qh_ver="0.3.2" > > > function initialize () { >@@ -72,7 +77,7 @@ > # > > scriptname=`basename $0` >- scriptdir=`dirname $0` >+ scriptdir=/etc/vdr/plugins/vdrrip > > cfgfile="$scriptname.conf" > >@@ -92,6 +97,7 @@ > log_error "usage: $scriptname queuefile tempdir" 1 > fi > >+ mkdir -p "$tempdir" > if [ ! -d "$tempdir" ] > then > log_error "directory $tempdir doesn't exist, aborting !" 1 >@@ -101,7 +107,7 @@ > > local pids=`pgrep -d" " "$scriptname"` > local pid1=`echo "$pids" | cut -d" " -f1` >- local pid2=`echo "$pids" | cut -d" " -f3` >+ local pid2=`echo "$pids" | cut -d" " -f2` > > if [ "$pid1" != "$pid2" ] > then >@@ -135,7 +141,8 @@ > IFS=";" > read dir name filesize filenumbers vcodec br_video min_q max_q \ > crop_w crop_h crop_x crop_y scale_w scale_h acodec br_audio audio_id \ >- ppvalues rename container preview < "$queuefile" >+ ppvalues rename container preview prevfnum prevsb prevframes \ >+ fnum sb frames < "$queuefile" > IFS=$saveifs > > # there is an active encoding >@@ -156,9 +163,9 @@ > fi > > if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi >- >+ > dvd=`echo "$dir" | grep "^dvd://"` >- >+ > if [ "$preview" = "1" ] > then > local mode="preview" >@@ -214,6 +221,17 @@ > mc=$mencoder > mp=$mplayer > fi >+ >+ # change the dvd-parameter to -dvd if the mencoder-version is 0.XX >+ if [ "$dvd" ] >+ then >+ local menc_ver=`$mc -v 2>/dev/null | grep "MEncoder" | sed "s/^MEncoder \(.\).*/\1/"` >+ if [ "$menc_ver" = "0" ] >+ then >+ dvd=`echo "$dvd" | sed "s/^dvd:\/\//-dvd /"` >+ fi >+ log_debug "dvd: $dvd" >+ fi > > # check needed tools > case "$container" in >@@ -229,12 +247,12 @@ > > if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ] > then >- check_exe "$ffmpeg" "ffmpeg=" >+ check_exe "$ffmpeg" "ffmpeg=" > fi > > if [ $filenumbers -gt 1 ] > then >- check_exe "$ogmsplit" "ogmsplit=" >+ check_exe "$ogmsplit" "ogmsplit=" > fi > ;; > "matroska") >@@ -243,7 +261,7 @@ > > if [ "$acodec" = "lame" -o "$acodec" = "ogg-vorbis" ] > then >- check_exe "$ffmpeg" "ffmpeg=" >+ check_exe "$ffmpeg" "ffmpeg=" > fi > ;; > *) >@@ -255,7 +273,7 @@ > > function calc_steps () { > # >-# calculate the nuber of encoding-steps >+# calculate the number of encoding-steps > # > if [ "$error" ]; then return > elif [ "$preview" = "1" ] >@@ -271,15 +289,13 @@ > > case "$container" in > "avi") >- let steps=steps-4 >- if [ "$dvd" ]; then let steps=steps-1 >- elif [ ! -e "$dir/002.vdr" ]; then let steps=steps-1; fi >+ let steps=steps-5 > ;; > "ogm") > let steps=steps-2 > if [ "$acodec" = "copy" -a $audio_id -ge 128 ] > then >- let steps=steps-1 >+ let steps=steps-1 > fi > ;; > "matroska") >@@ -301,11 +317,6 @@ > > name="$name(preview)" > shortname="$shortname(preview)" >- >- # start the preview in the middle of the movie >- local length=`"$mp" -identify -frames 0 "$dir/001.vdr" 2>/dev/null | grep ID_LENGTH | cut -d"=" -f2` >- let local ss=length/2 >- previewval="-ss $ss -endpos $previewlength" > } > > >@@ -316,27 +327,24 @@ > if [ "$error" ]; then return > elif [ "$dvd" ]; then return; fi > >+ # Recreate $tempdir if removed by vdr housekeeping >+ mkdir -p "$tempdir" >+ if [ ! -d "$tempdir" ]; then return; fi >+ cd "$tempdir" >+ > case "$container" in >- "avi") >- # join all vdr-files to $tempdir/temp.vdr >- if [ -e "$dir/002.vdr" -a "$preview" != "1" ] >- then >- log_info "joining all vdr-files from directory $dir" >- evecho "joining vdr-files" >- nice -+19 cat $dir/[0-9][0-9][0-9].vdr > "$tempdir/temp.vdr" >- else >- create_symbolic_link >- fi >- ;; > "ogm"|"matroska") > # demux vdr-recording with vdrsync >- if [ "$preview" = "1" ] >+ if [ "$preview" != "1" ] > then >- create_symbolic_link >- else > log_info "demuxing all vdr-files from directory $dir" >- evecho "demuxing vdr-files" >+ evecho "demuxing vdr-files" > execute "$vdrsync $dir -o $tempdir" >+ # vdrsync 0.1.2.2 developer version creates bd.mpa >+ if [ -e "$tempdir/bd.mpa" ] >+ then >+ mv "$tempdir/bd.mpa" "$tempdir/bd.ac3" >+ fi > fi > ;; > *) >@@ -345,25 +353,6 @@ > } > > >-function create_symbolic_link() { >-# >-# creates a symbolic link of 001.vdr to $temdir/temp.vdr >-# >- if [ "$error" ]; then return >- elif [ "$dvd" ]; then return; fi >- >- log_info "create a symbolic link from $dir/001.vdr to $tempdir/temp.vdr" >- ln -s "$dir/001.vdr" "$tempdir/temp.vdr" >- >- if [ ! -e "$tempdir/temp.vdr" ] >- then >- log_info "could not create a symolic link" >- log_info "try to copy $dir/001.vdr to $tempdir/temp.vdr" >- execute "cp $dir/001.vdr $tempdir/temp.vdr" >- fi >-} >- >- > function check_exe () { > # > # checks if $1 is a executable and exit the queuehandler with >@@ -389,18 +378,18 @@ > case "$acodec" in > "lame") > if [ "$dvd" ] >- then >+ then > local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2:vol=8 -aid $audio_id" >- else >+ else > local aopts="-oac mp3lame -lameopts br=$br_audio:abr:q=2 -aid $audio_id" >- fi >+ fi > ;; > "copy") > local aopts="-oac copy -aid $audio_id" > ;; >- "ogg-vorbis") >+ "ogg-vorbis") > # this shouldn't happen >- ;; >+ ;; > *) > log_error "unknown audio codec $acodec" > ;; >@@ -410,15 +399,15 @@ > local aopts="-nosound" > case "$acodec" in > "lame"|"ogg-vorbis") >- if [ "$dvd" ]; then dump_audio_mplayer; fi >+ if [ "$dvd" ]; then dump_audio_mplayer; fi > encode_ffmpeg >- ;; >+ ;; > "copy") > # convert mp2-files to ac3, because > # mp2 isn't supported by ogm >- if [ "$dvd" ]; then dump_audio_mplayer; fi >- if [ $audio_id -lt 128 ]; then encode_ffmpeg; fi >- ;; >+ if [ "$dvd" ]; then dump_audio_mplayer; fi >+ if [ $audio_id -lt 128 ]; then encode_ffmpeg; fi >+ ;; > *) > log_error "unknown audio codec $acodec" > ;; >@@ -428,12 +417,12 @@ > local aopts="-nosound" > case "$acodec" in > "lame"|"ogg-vorbis") >- if [ "$dvd" ]; then dump_audio_mplayer; fi >+ if [ "$dvd" ]; then dump_audio_mplayer; fi > encode_ffmpeg >- ;; >+ ;; > "copy") >- if [ "$dvd" ]; then dump_audio_mplayer; fi >- ;; >+ if [ "$dvd" ]; then dump_audio_mplayer; fi >+ ;; > *) > log_error "unknown audio codec $acodec" > ;; >@@ -443,47 +432,68 @@ > ;; > esac > >- # set mencoder -vop values >- if [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \ >- "$crop_y" = "-1" -a "$scale_w" = "-1" -a "$scale_h" = "-1" ] >+ # handle interlacing passthrough request >+ local mintopts="" >+ local xintopts="" >+ if [ "${ppvalues#codec_does_il}" != "$ppvalues" ] > then >- local vopopts="" >- elif [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \ >- "$crop_y" = "-1" ] >- then >- local vopopts="scale=$scale_w:$scale_h" >- else >- local vopopts="scale=$scale_w:$scale_h,crop=$crop_w:$crop_h:$crop_x:$crop_y" >+ local mintopts="ildct:ilme" >+ local xintopts="interlacing" >+ ppvalues = ${ppvalues#codec_does_il} >+ ppvalues = ${ppvalues#/} # if other pp options follow > fi > >- if [ "$ppvalues" ] >+ # build mencoder filterlist >+ local vfopts="$ppvalues" >+ >+ if [ ! "$crop_w $crop_h $crop_x $crop_y" = "-1 -1 -1 -1" ] > then >- local vopopts="-vop pp=$ppvalues,$vopopts" >- elif [ "$vopopts" ] >+ local vfopts="${vfopts},crop=$crop_w:$crop_h:$crop_x:$crop_y" >+ fi >+ >+ if [ ! "$scale_w $scale_h" = "-1 -1" ] > then >- local vopopts="-vop $vopopts" >+ local vfopts="${vfopts},scale=$scale_w:$scale_h" > fi > >+ # remove possible leading "," >+ local vfopts="-vf ${vfopts#,}" >+ > # encode in two passes > for pass in 1 2 > do > if [ "$pass" = "1" ] > then > local ofile="-o /dev/null" >+ local mturbo=":turbo" >+ local xturbo=":turbo" > else > local ofile="-o $tempdir/$name.avi" >+ if [ "$useropts_lavc" ]; then >+ log_info "\$useropts_lavc are set to \"$useropts_lavc\"" >+ mturbo="$mturbo:$useropts_lavc" >+ fi >+ if [ "$mintopts" ]; then >+ log_info "Encoding an interlaced stream with \"$mintopts\"" >+ mturbo="$mturbo:$mintopts" >+ fi >+ if [ "$useropts_xvid" ]; then >+ log_info "\$useropts_xvid are set to \"$useropts_xvid\"" >+ xturbo="$xturbo:$useropts_xvid" >+ fi >+ if [ "$xintopts" ]; then >+ log_info "Encoding an interlaced stream with \"$xintopts\"" >+ xturbo="$xturbo:$xintopts" >+ fi > fi > > # set mencoder video values > case "$vcodec" in > "lavc") >- local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass -sws 2" >+ local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass$mturbo -sws 2" > ;; > "xvid") >- local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass -sws 2" >- ;; >- "divx4") >- local vopts="-ovc divx4 -divx4opts br=$br_video:q=5:min_quant=$min_q:max_quant=$max_q:pass=$pass -sws 2" >+ local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass$xturbo -sws 2" > ;; > *) > log_error "unknown video codec $vcodec" >@@ -498,7 +508,31 @@ > elif [ "$container" = "avi" -o "$preview" = "1" ] > then > # no dvd, avi container >- local ifile="$tempdir/temp.vdr" >+ if [ -e "$dir/002.vdr" ] >+ then >+ local ifile="$tempdir/temp.vdr" >+ local vopts="-cache 4096 $vopts" >+ >+ if [ "$preview" = "1" ] >+ then >+ startpiping $prevfnum $dir/[0-9][0-9][0-9].vdr >+ else >+ startpiping $fnum $dir/[0-9][0-9][0-9].vdr >+ fi >+ else >+ local ifile="$dir/001.vdr" >+ fi >+ >+ # since the other containers use vdrsync, which handles vdr marks?? >+ # use the following only for avi (which is always used for preview too) >+ if [ "$preview" = "1" ] >+ then >+ if [ $prevframes -gt 0 ]; then local vopts="-frames $prevframes $vopts" ; fi >+ if [ "$prevsb" != "-1" ]; then local vopts="-sb $prevsb $vopts" ; fi >+ else >+ if [ $frames -gt 0 ]; then local vopts="-frames $frames $vopts" ; fi >+ if [ "$sb" != "-1" ]; then local vopts="-sb $sb $vopts" ; fi >+ fi > else > # no dvd, ogm/matroska container > >@@ -507,19 +541,19 @@ > while [ ! "$ifile" ] > do > if [ ! -e "$tempdir/e$num.mpv" ] >- then >- log_info "video-file $tempdir/e$num.mpv not found !" >- if [ $num -ge 9 ] >- then >- log_error "no video-stream found !" >- # exit loop >- local ifile="dummy" >- fi >- let num=num+1 >- else >- log_info "video-file $tempdir/e$num.mpv found !" >+ then >+ log_info "video-file $tempdir/e$num.mpv not found !" >+ if [ $num -ge 9 ] >+ then >+ log_error "no video-stream found !" >+ # exit loop >+ local ifile="dummy" >+ fi >+ let num=num+1 >+ else >+ log_info "video-file $tempdir/e$num.mpv found !" > local ifile="$tempdir/e$num.mpv" >- fi >+ fi > done > fi > >@@ -536,7 +570,7 @@ > > evecho "enc. $encstr ($pass. pass)" > if [ "$useropts" ]; then log_info "\$useropts are set to \"$useropts\""; fi >- execute "$mc $ifile $ofile $useropts $vopts $vopopts $aopts $previewval" >+ execute "$mc $useropts $vopts $vfopts $aopts $ifile $ofile" > done > } > >@@ -593,7 +627,7 @@ > > function merge_ogm_mkv() { > if [ "$error" ]; then return; fi >- if [ "$container" != "ogm" -a "$container" != "matroska" ]; then return; fi >+ if [ "$container" != "ogm" -a "$container" != "matroska" -o "$preview" = "1" ]; then return; fi > > > case "$container" in >@@ -610,33 +644,30 @@ > esac > > >- if [ "$preview" != "1" ] >- then >- case "$acodec" in >- "lame") >- local afile="$tempdir/c$audio_id.mp3" >- ;; >- "ogg-vorbis") >- local afile="$tempdir/c$audio_id.ogg" >- ;; >- "copy") >- if [ $audio_id -ge 128 ] >- then >- # ac3 >- local afile="$tempdir/bd.ac3" >- elif [ "$container" = "ogm" ] >- then >- # mpg2, container ogm >- local afile="$tempdir/c$audio_id.ac3" >- else >- # mpg2 >- local afile="$tempdir/c$audio_id.mpa" >- fi >- ;; >- *) >- ;; >- esac >- fi >+ case "$acodec" in >+ "lame") >+ local afile="$tempdir/c$audio_id.mp3" >+ ;; >+ "ogg-vorbis") >+ local afile="$tempdir/c$audio_id.ogg" >+ ;; >+ "copy") >+ if [ $audio_id -ge 128 ] >+ then >+ # ac3 >+ local afile="$tempdir/bd.ac3" >+ elif [ "$container" = "ogm" ] >+ then >+ # mpg2, container ogm >+ local afile="$tempdir/c$audio_id.ac3" >+ else >+ # mpg2 >+ local afile="$tempdir/c$audio_id.mpa" >+ fi >+ ;; >+ *) >+ ;; >+ esac > > log_info "merging movie $shortname into $filetype-container" > evecho "merging into $filetype-container" >@@ -702,7 +733,6 @@ > mp="" > > dvd="" >- previewval="" > error="" > > step="0" >@@ -729,8 +759,8 @@ > rm -f "$queuefile" > else > let lines=lines-1 >- tail -n $lines "$queuefile" > /tmp/queuefile.tmp >- mv /tmp/queuefile.tmp $queuefile >+ cp -a "$queuefile" /tmp/queuefile.tmp >+ tail -n $lines /tmp/queuefile.tmp > "$queuefile" > fi > > if [ "$error" ] >@@ -780,10 +810,16 @@ > # split file > execute "$mc -ovc copy -oac copy $tempdir/$name.avi \ > -ss $splitpos $endpos -o $tempdir/$ofile" >- >+ > # detect length of splitted file and add it to $splitpos > local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \ > grep ID_LENGTH | cut -d= -f2` >+ # repeat command if failed first time >+ if [ -z "$length" ] >+ then >+ length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \ >+ grep ID_LENGTH | cut -d= -f2` >+ fi > let splitpos=splitpos+length-overlap > let count=count+1 > done >@@ -832,7 +868,7 @@ > # > # echo $1 on stderr and write it to the syslog with priority user.error > # >- logger -s -p user.error -t [vdrrip-qh] "$1" >+ logger -s -p user.error -t vdrrip-qh "$1" > > if [ "$2" ] > then >@@ -848,7 +884,7 @@ > # > # echo $1 on stdout and write it to the syslog with priority user.info > # >- logger -s -p user.info -t [vdrrip-qh] "$1" 2>&1 >+ logger -s -p user.info -t vdrrip-qh "$1" 2>&1 > } > > >@@ -858,7 +894,7 @@ > # > if [ "$debug" = "1" ] > then >- logger -s -p user.debug -t [vdrrip-qh] "$1" >+ logger -s -p user.debug -t vdrrip-qh "$1" > fi > } > >@@ -874,10 +910,10 @@ > # execute $cmd and save the return-code: > if [ "$stdout" = "1" ] > then >- nice -+19 $cmd 2>/tmp/queuehandler.err >+ nice -n 19 $cmd 2>/tmp/queuehandler.err > local rc="$?" > else >- nice -+19 $cmd 1>/dev/null 2>/tmp/queuehandler.err >+ nice -n 19 $cmd 1>/dev/null 2>/tmp/queuehandler.err > local rc="$?" > fi > >@@ -921,6 +957,15 @@ > } > > >+function startpiping () { >+ shift $1 >+ >+ rm -f "$tempdir/temp.vdr" >+ mkfifo "$tempdir/temp.vdr" >+ >+ cat $@ > "$tempdir/temp.vdr" & >+} >+ > function wait_unlock () { > # > # wait until the queuefile is unlocked >diff -ur vdrrip-0.3.0/scripts/queuehandler.sh.conf vdrrip-0.3.0-new/scripts/queuehandler.sh.conf >--- vdrrip-0.3.0/scripts/queuehandler.sh.conf 2004-04-22 20:54:11.000000000 +0200 >+++ vdrrip-0.3.0-new/scripts/queuehandler.sh.conf 2007-09-26 08:05:39.000000000 +0200 >@@ -33,16 +33,16 @@ > > # this pathes are used for the encoding of vdr-recordings & dvd's. > # they _must_ point to an unpatched mencoder & mplayer >- mencoder="/usr/local/bin/mencoder" >- mplayer="/usr/local/bin/mplayer" >+ mencoder="/usr/bin/mencoder" >+ mplayer="/usr/bin/mplayer" > > # this pathes are only used for encoding a vdr-recording with > # selected ac3-stream. > # they _must_ point to an ac3-patched mencoder & mplayer. > # if you don't use this feature you should deactivate the option > # AC3 Support (MPlayer-patch inst.) in the plugins setup-menu. >- mencoder_ac3="/usr/local/bin/mencoder_ac3" >- mplayer_ac3="/usr/local/bin/mplayer_ac3" >+ mencoder_ac3="/usr/bin/mencoder" >+ mplayer_ac3="/usr/bin/mplayer" > > > # this string is added to the mencoder-command in the >@@ -52,11 +52,11 @@ > > > # optional tools (only needed for ogm/matroska-container) >- vdrsync="/usr/local/bin/vdrsync.pl" >- ffmpeg="/usr/local/bin/ffmpeg" >- ogmmerge="/usr/local/bin/ogmmerge" >- ogmsplit="/usr/local/bin/ogmsplit" >- mkvmerge="/usr/local/bin/mkvmerge" >+ vdrsync="/usr/bin/vdrsync.pl" >+ ffmpeg="/usr/bin/ffmpeg" >+ ogmmerge="/usr/bin/ogmmerge" >+ ogmsplit="/usr/bin/ogmsplit" >+ mkvmerge="/usr/bin/mkvmerge" > > > >@@ -64,8 +64,19 @@ > # from the queuehandler on your tv. > # You have to specify only $svdrpsend or $netcat. > # $netcat is only recommend, if perl isn't installed. >- svdrpsend="/usr/local/bin/svdrpsend.pl" >+ svdrpsend="/usr/bin/svdrpsend.pl" > #netcat="" > > vdrhostname="localhost" > >+ # These are the options beside the bitrate and eventually the >+ # interlace options passed to mencoder you can control the >+ # quality of the encoding by changing them here >+ >+ useropts_lavc="" >+ # For a high quality high bitrate encoding use: >+ #useropts_lavc="mbd=2:trell:cbp:mv0:cmp=3:subcmp=3" >+ useropts_xvid="" >+ # For a high quality high bitrate encoding use: >+ #useropts_xvid="me_quality=6:vhq=1:notrellis:max_bframes=2" >+ >diff -ur vdrrip-0.3.0/templates.c vdrrip-0.3.0-new/templates.c >--- vdrrip-0.3.0/templates.c 2004-04-15 19:23:00.000000000 +0200 >+++ vdrrip-0.3.0-new/templates.c 2007-09-28 21:51:57.000000000 +0200 >@@ -87,10 +87,10 @@ > for (int c = 0; c < NumTemplates; c++) { > if (strcmp(T[c].Name, "delete") != 0) { > fprintf(f, "%s;%i;%i;%i;%i;%s;%s;%i;%i;%s\n", T[c].Name, >- T[c].FileSize, T[c].FileNumbers, T[c].BitrateVideo, >- T[c].BitrateAudio, C->getVCodec(T[c].VCodec), >- C->getACodec(T[c].ACodec), T[c].ScaleType, T[c].Bpp, >- C->getContainer(T[c].Container)); >+ T[c].FileSize, T[c].FileNumbers, T[c].BitrateVideo, >+ T[c].BitrateAudio, C->getVCodec(T[c].VCodec), >+ C->getACodec(T[c].ACodec), T[c].ScaleType, T[c].Bpp, >+ C->getContainer(T[c].Container)); > } > } > fclose(f); >diff -ur vdrrip-0.3.0/vdrrip.c vdrrip-0.3.0-new/vdrrip.c >--- vdrrip-0.3.0/vdrrip.c 2004-04-22 19:40:38.000000000 +0200 >+++ vdrrip-0.3.0-new/vdrrip.c 2007-09-28 21:51:57.000000000 +0200 >@@ -69,9 +69,9 @@ > #endif // VDRRIP_DVD > , MPlayer, MEncoder > #ifdef VDRRIP_DVD >- , DVD >+ , DVD > #endif // VDRRIP_DVD >- ); >+ ); > return s; > } > >@@ -132,13 +132,21 @@ > if (access(MPlayer, X_OK) == -1) { > char *s = NULL; > asprintf(&s, "%s doesn't exist or isn't a executable !", MPlayer); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, s); >+#else > Interface->Error(s); >+#endif > FREE(s); > return NULL; > } else if (access(MEncoder, X_OK) == -1) { > char *s = NULL; > asprintf(&s, "%s doesn't exist or isn't a executable !", MEncoder); >+#if VDRVERSNUM >= 10307 >+ Skins.Message(mtError, s); >+#else > Interface->Error(s); >+#endif > FREE(s); > return NULL; > } else return new cMenuVdrrip(); >diff -ur vdrrip-0.3.0/vdrriprecordings.c vdrrip-0.3.0-new/vdrriprecordings.c >--- vdrrip-0.3.0/vdrriprecordings.c 2004-03-31 19:18:20.000000000 +0200 >+++ vdrrip-0.3.0-new/vdrriprecordings.c 2007-09-27 01:56:59.000000000 +0200 >@@ -10,7 +10,7 @@ > #include "vdrriprecordings.h" > #include "a-tools.h" > >-#define FINDRECCMD "find %s -follow -type d -regex '.*rec$'" >+#define FINDRECCMD "find %s -follow -type d -regex '.*rec$' | sort" > > // --- cVdrripRecordings ----------------------- >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193865
:
131988
|
131989
|
131991
|
131992
|
132042
| 132147