Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 132042 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 - updated
vdrrip-0.3.0-20070925-vdr1.3.7-mplayer-merged.diff (text/plain), 47.18 KB, created by
cmuelle8
on 2007-09-27 21:59:46 UTC
(
hide
)
Description:
files/vdrrip-0.3.0-20070925-vdr1.3.7-mplayer-merged.diff - updated
Filename:
MIME Type:
Creator:
cmuelle8
Created:
2007-09-27 21:59:46 UTC
Size:
47.18 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/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-27 03:09:46.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; > } >@@ -160,7 +199,11 @@ > 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; >@@ -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(); > } >@@ -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); > } >@@ -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(); >@@ -646,6 +717,8 @@ > > 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; >@@ -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 >@@ -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(); >@@ -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"); >@@ -1062,12 +1162,20 @@ > q->Rename = VdrripSetup.Rename; > q->Container = M->C->getContainer(M->getContainer()); > q->Preview = p; >+ 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); >@@ -1089,11 +1197,20 @@ > } 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(); >+#endif > if (! M->setCropValues()) { > 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(); > } >@@ -1133,11 +1250,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 +1282,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; >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-27 01:26:38.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; > >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-27 23:23:57.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) { >@@ -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,10 @@ > CalcAspect = Aspect; > } > >+long long 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; >@@ -383,12 +434,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 +476,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 +539,49 @@ > } > > >+void cMovie::setMarksVDR() { >+ Frames = StartByte = -1; >+ cMarks *vdrmarks = new cMarks(); >+ vdrmarks->Load(Dir); >+ >+ if (vdrmarks->GetNext(StartByte)) StartByte = vdrmarks->GetNext(0)->position; >+ if (vdrmarks->GetNext(StartByte)) Frames = vdrmarks->GetNext(StartByte)->position - StartByte; >+ FREE(vdrmarks); >+ >+ if (Frames > -1) { >+ asprintf(&Marks, "%s - %s", >+ (const char*) IndexToHMSF(StartByte, true), >+ (const char*) IndexToHMSF(Frames, true) >+ ); >+ >+ isyslog("[vdrrip] found two valid marks: encoding from %s..", Marks); >+ >+ /* If the index is not OK, we simply encode Frames number of frames, >+ * since we do not need the index to compute this value for mplayer. */ >+ cIndexFile *vdrindex = new cIndexFile(Dir, false); >+ if (vdrindex->Ok()) { >+ uchar fnum = 0; >+ int foff = 0; >+ >+ if (vdrindex->Get(StartByte, &fnum, &foff)) { >+ Frames -= StartByte; // will be mplayer endpos >+ StartByte = (fnum-1)*MAXVIDEOFILESIZE*1024LL*1024LL + (long long)(foff); >+ } else { StartByte = 0 ; } >+ } else { StartByte = 0 ; } >+ >+ /* Update Length for Bitrate, Filesize computation.. fps must be known for this*/ >+ Length = Frames / Fps ; >+ } else { >+ FREE(Marks); >+ Marks = NULL; >+ } >+} >+ >+ > 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 +602,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,7 +626,7 @@ > 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) { >@@ -630,11 +718,11 @@ > > FILE *f = fopen(file,"w"); > if (f) { >- fprintf(f,"%s;%i;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%s;%s;%d\n", >+ fprintf(f,"%s;%i;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%s;%s;%lld;%lld;%d\n", > Name, FileSize, FileNumbers, Bitrate, C->getVCodec(VCodec), BitrateVideo, > CropWidth, CropHeight, CropPosX, CropPosY, ScaleType, ScaleWidth, > ScaleHeight, Bpp, C->getACodec(ACodec), BitrateAudio, AudioID, PPValues, >- T->getName(NumTemplate), C->getContainer(Container), >+ T->getName(NumTemplate), C->getContainer(Container), StartByte, Frames, > #ifdef VDRRIP_DVD > Dvd ? Title : 0 > #else >@@ -661,12 +749,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 +764,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; >@@ -684,18 +771,15 @@ > // migrate from version 0.1.1 > container = strcol(buf, ";", 20); > if (! container) container = strdup("avi"); >+ StartByte = atoll(strcol(buf, ";", 21)); >+ Frames = atoll(strcol(buf, ";", 22)); > #ifdef VDRRIP_DVD > // migrate from version 0.2.0a >- if (Dvd) Title = atoi(strcol(buf, ";", 21)); >+ if (Dvd) Title = atoi(strcol(buf, ";", 23)); > #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) { >@@ -716,7 +800,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); >@@ -951,7 +1039,7 @@ > 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) { >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-27 23:28:09.000000000 +0200 >@@ -42,6 +42,7 @@ > > char *OrigName; > char *Name; >+ char *Marks; > char *Dir; > int Length; > int FileSize; >@@ -62,6 +63,8 @@ > int CropHeight; > int CropPosX; > int CropPosY; >+ long long StartByte; >+ int Frames; > int Bpp; > int Container; > int VCodec; >@@ -71,7 +74,6 @@ > struct AudioData *A; > char *PPValues; > >- char *MarksFile; > char **StrAudioData; > char **StrAudioData2; > >@@ -116,12 +118,16 @@ > 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(); >+ long long getStartByte(); >+ int getFrames(); >+ char* getMarks(); > void setBpp(int i); > double getBpp(); > double getResBpp(); >@@ -142,6 +148,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-27 02:49:41.000000000 +0200 >@@ -54,10 +54,15 @@ > 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"); >+ cont ? Q[c].Container = cont : Q[c].Container = strdup("avi"); > // migrate from version 0.2.0a > char *prev = strcol(buf, ";", 21); >- prev ? Q[c].Preview = atoi(prev) : Q[c].Preview = 0; >+ prev ? Q[c].Preview = atoi(prev) : Q[c].Preview = 0; >+ // migrate from version 0.3.0 >+ char *sb = strcol(buf, ";", 22); >+ sb ? Q[c].StartByte = atoll(sb) : Q[c].StartByte = 0; >+ char *frames = strcol(buf, ";", 23); >+ frames ? Q[c].Frames = atoi(frames) : Q[c].Frames = 0; > > FREE(buf); > c++; >@@ -84,12 +89,13 @@ > 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;%lld;%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); >+ Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview, >+ Q[c].StartByte, Q[c].Frames); > n++; > } > } >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-27 02:46:44.000000000 +0200 >@@ -31,6 +31,8 @@ > int Rename; > char *Container; > int Preview; >+ long long 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-27 03:41:01.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,7 @@ > 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 sb frames < "$queuefile" > IFS=$saveifs > > # there is an active encoding >@@ -156,9 +162,9 @@ > fi > > if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi >- >+ > dvd=`echo "$dir" | grep "^dvd://"` >- >+ > if [ "$preview" = "1" ] > then > local mode="preview" >@@ -214,6 +220,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 >@@ -302,10 +319,7 @@ > 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" >+ previewval="-sb $(($(du -b "$dir/001.vdr" | cut -f 1) >> 1)) -endpos $previewlength" > } > > >@@ -316,27 +330,31 @@ > 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 >+ log_info "piping all vdr-files in $dir" >+ evecho "piping all vdr-files" > 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" > 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 +363,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 >@@ -443,25 +442,35 @@ > ;; > esac > >- # set mencoder -vop values >+ # handle interlacing passthrough request >+ local mintopts="" >+ local xintopts="" >+ if [ "${ppvalues#codec_does_il}" != "$ppvalues" ] >+ then >+ local mintopts="ildct:ilme" >+ local xintopts="interlacing" >+ ppvalues = ${ppvalues:14} >+ fi >+ >+ # set mencoder -vf 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" ] > then >- local vopopts="" >+ local vfopts="" > elif [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \ > "$crop_y" = "-1" ] > then >- local vopopts="scale=$scale_w:$scale_h" >+ local vfopts="scale=$scale_w:$scale_h" > else >- local vopopts="scale=$scale_w:$scale_h,crop=$crop_w:$crop_h:$crop_x:$crop_y" >+ local vfopts="crop=$crop_w:$crop_h:$crop_x:$crop_y,scale=$scale_w:$scale_h" > fi > > if [ "$ppvalues" ] > then >- local vopopts="-vop pp=$ppvalues,$vopopts" >- elif [ "$vopopts" ] >+ local vfopts="-vf pp=$ppvalues,$vfopts" >+ elif [ "$vfopts" ] > then >- local vopopts="-vop $vopopts" >+ local vfopts="-vf $vfopts" > fi > > # encode in two passes >@@ -470,20 +479,35 @@ > 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 +522,20 @@ > 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" >+ rm -f "$ifile" >+ mkfifo "$ifile" >+ ( cat "$dir"/[0-9][0-9][0-9].vdr > "$ifile" & ) >+ else >+ local ifile="$dir/001.vdr" >+ fi >+ >+ # since the other containers use vdrsync, which handles vdr marks?? >+ # use the following only for this containertype >+ if [ $frames -gt 0 ]; then local vopts="-frames $frames $vopts" ; fi >+ if [ "$sb" != "-1" ]; then local vopts="-sb $sb $vopts" ; fi > else > # no dvd, ogm/matroska container > >@@ -511,11 +548,11 @@ > 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 >+ 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" >@@ -536,7 +573,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 $ifile $ofile $useropts $vopts $vfopts $aopts $previewval" > done > } > >@@ -729,8 +766,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" ] >@@ -784,6 +821,12 @@ > # 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 +875,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 +891,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 +901,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 +917,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 > >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/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-26 08:05:39.000000000 +0200 >@@ -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