From patchwork Fri Nov 15 15:08:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFya28gTcOka2Vsw6Q=?= X-Patchwork-Id: 20736 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1VhL0o-0006OW-Vp; Fri, 15 Nov 2013 16:08:47 +0100 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1VhL0l-0006OR-VN for vdr@linuxtv.org; Fri, 15 Nov 2013 16:08:45 +0100 X-tubIT-Incoming-IP: 62.142.5.109 Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtps [TLSv1:AES256-SHA:256] for id 1VhL0k-0004FZ-1d; Fri, 15 Nov 2013 16:08:43 +0100 Received: from localhost (a88-113-228-58.elisa-laajakaista.fi [88.113.228.58]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 0FB811887F6 for ; Fri, 15 Nov 2013 17:08:38 +0200 (EET) Date: Fri, 15 Nov 2013 17:08:38 +0200 From: Marko =?iso-8859-1?B?TeRrZWzk?= To: vdr@linuxtv.org Message-ID: <20131115150838.GB4009@x220> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.11.15.145714 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' RCVD_FROM_IP_DATE 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODY_SIZE_10000_PLUS 0, INVALID_MSGID_NO_FQDN 0, NO_URI_FOUND 0, __C230066_P5 0, __CD 0, __CP_MEDIA_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __OEM_PRICE 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __USER_AGENT 0' X-LSpam-Score: 0.9 (/) X-LSpam-Report: No, score=0.9 required=5.0 tests=BAYES_00=-1.9, LONGWORDS=2.035, RDNS_NONE=0.793 autolearn=no Subject: [vdr] Valgrind warnings with LCARS OSD X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org Hi all, I played a little with Valgrind: valgrind --vgdb=yes --vgdb-error=0 ./vdr ... and in gdb, (gdb) target remote |vgdb This seems to give me a false alarm for cRecording::cRecording(): Program received signal SIGTRAP, Trace/breakpoint trap. 0x0811951a in cRecording::cRecording (this=0xbee4d958, FileName=0x0) at recording.c:801 801 if (*(fileName + strlen(fileName) - 1) == '/') The machine code is doing some magic after the strdup() on the previous line. I suspect that it is gcc that is performing strlen() with some black magic that trips this warning: ==3212== Invalid read of size 4 ==3212== at 0x811951A: cRecording::cRecording(char const*) (recording.c:801) ==3212== by 0x80CEF77: cDvbPlayer::cDvbPlayer(char const*, bool) (dvbplayer.c:268) ==3212== Address 0x4454004 is 76 bytes inside a block of size 78 alloc'd ==3212== at 0x4028308: malloc (vg_replace_malloc.c:263) ==3212== by 0x4315E1F: strdup (strdup.c:43) ==3212== by 0x81194FE: cRecording::cRecording(char const*) (recording.c:800) Then I got and fixed many warnings in Softdevice, which forgot to initialize some class members in constructors. Finally, I got a real warning for VDR: ==3212== Conditional jump or move depends on uninitialised value(s) ==3212== at 0x4029654: __GI_strcmp (mc_replace_strmem.c:712) ==3212== by 0x813ACD8: cSkinLCARSDisplayReplay::DrawTrack() (skinlcars.c:1786) ==3212== by 0x813AE9F: cSkinLCARSDisplayReplay::Flush() (skinlcars.c:1861) ==3212== by 0x80FCA55: cReplayControl::ShowProgress(bool) (menu.c:4670) ==3212== by 0x80FCBF7: cReplayControl::ShowTimed(int) (menu.c:4583) ==3212== by 0x80FCDEF: cReplayControl::cReplayControl(bool) (menu.c:4510) ==3212== by 0x80AC745: main (vdr.c:1307) "(gdb) monitor get_vbits" tells me that all of lastTrackId is uninitialized: (gdb) up #1 0x0813acd9 in cSkinLCARSDisplayReplay::DrawTrack ( this=this@entry=0x457c3a0) at skinlcars.c:1786 1786 if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { (gdb) p lastTrackId $27 = {id = 0, language = "\000\000\000\000\000\000\000", description = '\000' } (gdb) p &lastTrackId $28 = (tTrackId *) 0x457c434 (gdb) p sizeof lastTrackId $29 = 42 (gdb) monitor get_vbits 0x457c434 42 ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffff BTW, !Track && x || Track && y should IMO be simpler written Track ? y : x. It looks like a memset() is missing from the cSkinLCARSDisplayReplay constructor. cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel() is doing the right thing: memset(&lastTrackId, 0, sizeof(lastTrackId)); Adding the memset() made this message go away. (Patch attached.) The next problem is this one, which I get every time by pressing Play, Pause, Menu, Recordings after startup: ==3601== Conditional jump or move depends on uninitialised value(s) ==3601== at 0x810C0DB: cRect::Intersected(cRect const&) const (osd.h:411) ==3601== by 0x810E3D1: cPixmapMemory::DrawRectangle(cRect const&, unsigned int) (osd.c:1333) ==3601== by 0x810AA0B: cOsd::DrawRectangle(int, int, int, int, unsigned int) (osd.c:1922) ==3601== by 0x8130482: cSkinLCARSDisplayMenu::Clear() (skinlcars.c:1463) ==3601== by 0x810651F: cOsdMenu::Display() (osdbase.c:223) ==3601== by 0x80FA3D1: cMenuMain::Set() (menu.c:3432) ==3601== by 0x80FA9FD: cMenuMain::cMenuMain(eOSState, bool) (menu.c:3376) ==3601== by 0x80AC21B: main (vdr.c:1078) According to "monitor get_vbits", the cRect is totally uninitialized. Program received signal SIGTRAP, Trace/breakpoint trap. 0x0810c0db in IsEmpty (this=0xbeba08a0) at osd.h:411 411 bool IsEmpty(void) const { return Width() <= 0 || Height() <= 0; } (gdb) up #1 cRect::Intersected (this=this@entry=0xbeba08a0, Rect=...) at osd.c:912 912 if (!IsEmpty() && !Rect.IsEmpty()) { (gdb) up #2 0x0810e3d2 in cPixmapMemory::DrawRectangle (this=0x6d3fe78, Rect=..., Color=2566914048) at osd.c:1333 1333 cRect r = Rect.Intersected(DrawPort().Size()); As far as I can tell, the entirely uninitialized cRect is being passed as the Rect parameter to cPixmapMemory::DrawRectangle(). Unfortunately, gdb cannot show me the stack above that. It would seem to me that cSkinLCARSDisplayMenu::Clear() is passing uninitialized bounds to cOsd::DrawRectangle(), which will lead to funny values like this: (gdb) p *this $31 = {point = {x = 1418239204, y = 0}, size = {width = -1379480940, height = 201}, static Null = {point = {x = 0, y = 0}, size = {width = 0, height = 0}, static Null = }} As a workaround, I guess that I will be switching away from the LCARS skin for now. I got into this exercise because vdr sometimes crashed when I pressed the Recordings or Menu button when using the LCARS skin. I am also attaching my patch against softdevice CVS, in case someone finds it useful. I was unable to figure out how to clear the garbage at the bottom of the OSD screen. It goes away if the dfb:mgatv video display area is high enough (4:3 video instead of 16:9). Best regards, Marko Index: SoftOsd.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/SoftOsd.c,v retrieving revision 1.37 diff -p -u -r1.37 SoftOsd.c --- SoftOsd.c 17 Apr 2011 16:06:31 -0000 1.37 +++ SoftOsd.c 15 Nov 2013 15:03:17 -0000 @@ -25,7 +25,6 @@ //#define SCALEDEBV(out...) printf(out) //#define SCALEDEBH(out...) printf(out) - #ifndef OSDDEB #define OSDDEB(out...) #endif @@ -55,16 +54,17 @@ #define COLOR_64BIT(x) ( ((x)<<32) | (x) ) #define ALPHA_VALUE(x) ( (x) << 24 ) -// the same constants for MMX mode +//#undef USE_MMX +//#undef USE_MMX2 + +#ifdef USE_MMX2 static uint64_t transparent_thr= COLOR_64BIT(ALPHA_VALUE(TRANSPARENT_THRESHOLD>>1)); static uint64_t opacity_thr= COLOR_64BIT(ALPHA_VALUE(OPACITY_THRESHOLD>>1)); static uint64_t pseudo_transparent = COLOR_64BIT(COLOR_KEY); +#endif // USE_MMX2 int cSoftOsd::colorkey; -//#undef USE_MMX -//#undef USE_MMX2 - #undef SPLAT_U16 #ifdef USE_MMX2 #define SPLAT_U16(X) " pshufw $0b0, " X ", " X " \n" @@ -77,69 +77,59 @@ int cSoftOsd::colorkey; */ #if VDRVERSNUM >= 10509 cSoftOsd::cSoftOsd(cVideoOut *VideoOut, int X, int Y, uint level) - : cOsd(X, Y, level),active(false),close(false) { + : cOsd(X, Y, level), shown(false) { #else cSoftOsd::cSoftOsd(cVideoOut *VideoOut, int X, int Y) - : cOsd(X, Y),active(false),close(false) { + : cOsd(X, Y), shown(false) { #endif OSDDEB("cSoftOsd constructor\n"); OutputConvert=&cSoftOsd::ARGB_to_ARGB32; bitmap_Format=PF_None; // forces a clear after first SetMode - OSD_Bitmap=new uint32_t[OSD_STRIDE*(OSD_HEIGHT+4)]; + OSD_Bitmap=new tColor[OSD_STRIDE*(OSD_HEIGHT+4)]; videoOut = VideoOut; xPan = yPan = 0; - shown = false; - voutMutex.Lock(); videoOut->OpenOSD(); colorkey=videoOut->GetOSDColorkey(); +#ifdef USE_MMX2 pseudo_transparent=(uint64_t)colorkey | ((uint64_t) colorkey)<<32; +#endif // USE_MMX2 - xOfs=X;yOfs=Y; ScreenOsdWidth=ScreenOsdHeight=0; int Depth=16; bool HasAlpha=false; bool AlphaInversed=false; bool IsYUV=false; videoOut->AdjustOSDMode(); videoOut->GetOSDMode(Depth,HasAlpha,AlphaInversed,IsYUV); SetMode(Depth,HasAlpha,AlphaInversed,IsYUV); - voutMutex.Unlock(); }; /*--------------------------------------------------------------------------*/ void cSoftOsd::Clear() { OSDDEB("Clear\n"); - uint32_t blank=0x00000000; //COLOR_KEY; +#if VDRVERSNUM >= 10509 + if (!cOsd::Active()) return; +#endif + tColor blank=tColor(COLOR_KEY); ConvertPalette((tColor *)&blank,(tColor *)&blank,1); register uint32_t fill=blank; - for (int i=OSD_STRIDE*(OSD_HEIGHT+2)-1; i!=0; i--) - OSD_Bitmap[i]=fill; - OSD_Bitmap[0]=fill; - // no dirty lines, everything has to be redrawn anyway - memset(dirty_lines,false,sizeof(dirty_lines)); + if (fill == (fill & 0xff) * 0x1010101) { + memset(OSD_Bitmap, fill, + OSD_STRIDE*(OSD_HEIGHT+4) * sizeof *OSD_Bitmap); + } else { + register tColor *b=OSD_Bitmap; + register const tColor *const e=b + OSD_STRIDE*(OSD_HEIGHT+4); + while (b < e) *b++=fill; + } + + memset(dirty_lines,true,sizeof(dirty_lines)); } /* --------------------------------------------------------------------------*/ cSoftOsd::~cSoftOsd() { OSDDEB("cSoftOsd destructor\n"); - close=true; - active=false; Cancel(3); - if (videoOut -#if VDRVERSNUM >= 10509 - && cOsd::Active() -#endif - ) { - voutMutex.Lock(); - videoOut->CloseOSD(); -#ifdef HAVE_YAEPGPATCH - if (vidWin.bpp!=0) - videoOut->SetVidWin(0,0,0,0,0); -#endif - videoOut=0; - voutMutex.Unlock(); - } delete[] OSD_Bitmap; } @@ -148,10 +138,6 @@ eOsdError cSoftOsd::SetAreas(const tArea { if (shown) { Clear(); -#if VDRVERSNUM >= 10509 - if (cOsd::Active()) -#endif - videoOut->ClearOSD(); shown = false; } return cOsd::SetAreas(Areas, NumAreas); @@ -176,22 +162,25 @@ void cSoftOsd::SetActive(bool On) /* -------------------------------------------------------------------------*/ void cSoftOsd::Action() { OSDDEB("OSD thread started\n"); - active=true; - while(active && videoOut && !close) { + + voutMutex.Lock(); + + while (Running() && videoOut) { int newOsdWidth; int newOsdHeight; int newXPan, newYPan; - voutMutex.Lock(); if (!videoOut #if VDRVERSNUM >= 10509 || !cOsd::Active() #endif - ) { + ) { +sleep: voutMutex.Unlock(); usleep(17000); + voutMutex.Lock(); continue; - }; + } videoOut->AdjustOSDMode(); videoOut->GetOSDDimension(newOsdWidth,newOsdHeight,newXPan,newYPan); @@ -216,14 +205,22 @@ void cSoftOsd::Action() { ScreenOsdHeight!=newOsdHeight || modeChanged ) { OSDDEB("Resolution or mode changed!\n"); - if (modeChanged) - videoOut->ClearOSD(); OsdCommit(); } - voutMutex.Unlock(); - usleep(17000); + goto sleep; } + + if ( +#if VDRVERSNUM >= 10509 + cOsd::Active() +#else + true +#endif + ) { + if (videoOut) videoOut->ClearOSD(); + } + voutMutex.Unlock(); OSDDEB("OSD thread ended\n"); } @@ -373,9 +370,7 @@ void cSoftOsd::Flush(void) { pthread_yield(); #endif - if (!active && !close) - Start(); - + Start(); shown = true; } @@ -385,8 +380,16 @@ bool cSoftOsd::FlushBitmaps(bool OnlyDir bool OSD_changed=false; OSDDEB("FlushBitmaps (OnlyDirty: %d)\n",OnlyDirty); - for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) { - OSD_changed |= DrawConvertBitmap(Bitmap,OnlyDirty); + if (IsTrueColor()) { + LOCK_PIXMAPS; + while (cPixmapMemory *pm = RenderPixmaps()) { + OSD_changed |= DrawConvertPixmap(pm); + delete pm; + } + } else { + for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) { + OSD_changed |= DrawConvertBitmap(Bitmap,OnlyDirty); + } } return OSD_changed; }; @@ -435,7 +438,7 @@ bool cSoftOsd::DrawConvertBitmap(cBitmap cMutexLock dirty(&dirty_Mutex); OSDDEB("DrawConvertBitmap %p, OnlyDirty %d\n",bitmap,OnlyDirty); - if ( !bitmap->Dirty(x1,y1,x2,y2) && OnlyDirty) + if (OnlyDirty && !bitmap->Dirty(x1,y1,x2,y2)) return false; if (!OnlyDirty) { @@ -458,14 +461,14 @@ bool cSoftOsd::DrawConvertBitmap(cBitmap y2++; x2++; - y2= yOfs+y2+bitmap->Y0() > OSD_HEIGHT ? - OSD_HEIGHT-bitmap->Y0()-yOfs : y2; - x2= xOfs+x2+bitmap->X0() > OSD_WIDTH ? - OSD_WIDTH-bitmap->X0()-xOfs : x2; + y2= Top()+y2+bitmap->Y0() > OSD_HEIGHT ? + OSD_HEIGHT-bitmap->Y0()-Top() : y2; + x2= Left()+x2+bitmap->X0() > OSD_WIDTH ? + OSD_WIDTH-bitmap->X0()-Left() : x2; - int bitmap_yOfs=yOfs+bitmap->Y0()+Y_OFFSET; + int bitmap_yOfs=Top()+bitmap->Y0(); uint32_t *OSD_pointer=&OSD_Bitmap[(bitmap_yOfs+y1)*OSD_STRIDE+ - xOfs+bitmap->X0()+x1+X_OFFSET]; + Left()+bitmap->X0()+x1]; int missing_line_length=OSD_STRIDE-(x2-x1); bool *dirty_line=&dirty_lines[bitmap_yOfs+y1]; @@ -480,6 +483,42 @@ bool cSoftOsd::DrawConvertBitmap(cBitmap return true; }; +bool cSoftOsd::DrawConvertPixmap(cPixmapMemory *pm) +{ + int x1,x2,y1,y2; + const tColor *src=reinterpret_cast(pm->Data()); + OSDDEB("DrawConvertPixmap %p\n",pm); + + x1=Left(); + y1=Top(); + + x1+=pm->ViewPort().X(); + x2=x1 + pm->ViewPort().Width(); + y1+=pm->ViewPort().Y(); + y2=y1 + pm->ViewPort().Height(); + src+=pm->DrawPort().X() + pm->DrawPort().Y() * pm->DrawPort().Width(); + + OSDDEB("drawing pixmap %p from (%d,%d) to (%d,%d)\n", + pm,x1,y1,x2,y2); + + if (y1 > OSD_HEIGHT) y1=OSD_HEIGHT; + if (x1 > OSD_WIDTH) x1=OSD_WIDTH; + if (y2 > OSD_HEIGHT) y2=OSD_HEIGHT; + if (x2 > OSD_WIDTH) x2=OSD_WIDTH; + + cMutexLock dirty(&dirty_Mutex); + + tColor *dst=&OSD_Bitmap[y1*OSD_STRIDE+x1]; + + for (int y=y1; yDrawPort().Width(); + dst += OSD_STRIDE; + } + + return y1 != y2; +} + /*----------------------------------------------------------------------*/ void cSoftOsd::ARGB_to_AYUV(uint32_t * dest, color * pixmap, int Pixel) { Index: SoftOsd.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/SoftOsd.h,v retrieving revision 1.21 diff -p -u -r1.21 SoftOsd.h --- SoftOsd.h 17 Apr 2011 17:22:18 -0000 1.21 +++ SoftOsd.h 15 Nov 2013 15:03:17 -0000 @@ -17,11 +17,11 @@ #include // osd some constants and macros -#define OPACITY_THRESHOLD 0x9FLL -#define TRANSPARENT_THRESHOLD 0x1FLL +#define OPACITY_THRESHOLD 0x1FLL +#define TRANSPARENT_THRESHOLD 0x0FLL #define COLOR_KEY 0x00000000LL -#if VDRVERSNUM <= 10707 +#if 1//VDRVERSNUM <= 10707 #define OSD_WIDTH 720 #define OSD_HEIGHT 576 @@ -35,18 +35,11 @@ #endif -#define IS_BACKGROUND(a) (((a) < OPACITY_THRESHOLD) && ((a) > TRANSPARENT_THRESHOLD)) +#define IS_BACKGROUND(a) (((a) < OPACITY_THRESHOLD) && ((a) >= TRANSPARENT_THRESHOLD)) #define IS_TRANSPARENT(a) ((a) < TRANSPARENT_THRESHOLD) -#define IS_OPAQUE(a) ((a) > OPACITY_THRESHOLD) #include "video.h" -#define X_OFFSET 0 -#define Y_OFFSET 0 - - -#define COLOR_RGB16(r,g,b) (((b >> 3)& 0x1F) | ((g & 0xF8) << 2)| ((r & 0xF8)<<10) ) - #define GET_A(x) ((x) >> 24 & 0xFF) #define GET_R(x) ((x) >> 16 & 0xFF) #define GET_G(x) ((x) >> 8 & 0xFF) @@ -56,31 +49,23 @@ #define SET_R(x) ((x) << 16 & 0x00FF0000) #define SET_G(x) ((x) << 8 & 0x0000FF00) #define SET_B(x) ((x) << 0 & 0x000000FF) -/* -struct color { - unsigned char b; - unsigned char g; - unsigned char r; - unsigned char a; -}; -*/ -typedef uint32_t color; + +typedef tColor color; class cVideoOut; /* --------------------------------------------------------------------------- */ -class cSoftOsd : public cOsd,cThread { +class cSoftOsd : public cOsd, cThread { private: cMutex voutMutex; // lock all operations on videoOut! cVideoOut *videoOut; protected: static int colorkey; - int xOfs, yOfs; int xPan, yPan; - uint32_t *OSD_Bitmap; bool dirty_lines[OSD_HEIGHT+10]; cMutex dirty_Mutex; + tColor* OSD_Bitmap; void (*OutputConvert)(uint8_t * dest, color * pixmap, int Pixel, int odd); enum PixFormat { @@ -96,8 +81,6 @@ protected: void ConvertPalette(tColor *dest_palette, const tColor *orig_palette, int maxColors); - bool active; - bool close; bool shown; int ScreenOsdWidth; int ScreenOsdHeight; @@ -126,6 +109,7 @@ protected: bool FlushBitmaps(bool OnlyDirty); bool DrawConvertBitmap(cBitmap *Bitmap, bool OnlyDirty); + bool DrawConvertPixmap(cPixmapMemory* pm); void OsdCommit(bool forced = false); // may only be called if the caller holds voutMutex Index: VideoFilter.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/VideoFilter.c,v retrieving revision 1.11 diff -p -u -r1.11 VideoFilter.c --- VideoFilter.c 18 Apr 2008 15:10:35 -0000 1.11 +++ VideoFilter.c 15 Nov 2013 15:03:17 -0000 @@ -286,7 +286,7 @@ void cImageConvert::Filter(sPicBuffer *& #ifdef USE_SWSCALE sws_scale(img_convert_ctx, avpic_src.data, avpic_src.linesize, 0, orig->height, avpic_dest.data, avpic_dest.linesize); -#else +#elif 0 if (img_convert(&avpic_dest,PIX_FMT_YUV420P, &avpic_src, orig->format, orig->width, orig->height) < 0) { @@ -295,6 +295,9 @@ void cImageConvert::Filter(sPicBuffer *& "[softdevice] error, libavcodec img_convert failure\n"); return; } +#else + dest = orig; + return; #endif CopyPicBufferContext(dest,orig); } Index: configure =================================================================== RCS file: /cvsroot/softdevice/softdevice/configure,v retrieving revision 1.50 diff -p -u -r1.50 configure --- configure 21 Sep 2008 12:55:57 -0000 1.50 +++ configure 15 Nov 2013 15:03:17 -0000 @@ -218,7 +218,7 @@ if test "${use_pkgconfig}" = "yes" ; the if test "${ffmpeg_use_path}" = "no" ; then echo "try to use pkg-config." >> config.log -ffmpeg_l1="libavformat libavcodec" +ffmpeg_l1="libavformat libavcodec libavutil zlib" pkg-config --libs libpostproc >> config.log 2>&1 && { ffmpeg_l1="$ffmpeg_l1 libpostproc";libpostproc="yes"; } Index: i18n.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/i18n.c,v retrieving revision 1.25 diff -p -u -r1.25 i18n.c --- i18n.c 14 Apr 2008 02:28:09 -0000 1.25 +++ i18n.c 15 Nov 2013 15:03:18 -0000 @@ -7,6 +7,7 @@ */ #include "i18n.h" +#if 0 const tI18nPhrase Phrases[] = { { "Softdevice", // 1 @@ -1343,3 +1344,4 @@ const tI18nPhrase Phrases[] = { }, { NULL } }; +#endif Index: i18n.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/i18n.h,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 i18n.h --- i18n.h 1 Aug 2004 05:07:04 -0000 1.1.1.1 +++ i18n.h 15 Nov 2013 15:03:18 -0000 @@ -11,6 +11,4 @@ #include -extern const tI18nPhrase Phrases[]; - #endif //_I18N__H Index: mpeg2decoder.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/mpeg2decoder.c,v retrieving revision 1.90 diff -p -u -r1.90 mpeg2decoder.c --- mpeg2decoder.c 17 Apr 2011 17:22:18 -0000 1.90 +++ mpeg2decoder.c 15 Nov 2013 15:03:18 -0000 @@ -162,7 +162,7 @@ cStreamDecoder::cStreamDecoder(AVCodecCo #if HAS_ERROR_RECOGNITION context->error_recognition=1; #else - context->error_resilience=1; + context->error_concealment=1; #endif CMDDEB("Neuer StreamDecoder Pid: %d context %p type %d\n", getpid(),context,context->codec_type ); Index: shm-common.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/shm-common.h,v retrieving revision 1.9 diff -p -u -r1.9 shm-common.h --- shm-common.h 10 May 2007 19:49:51 -0000 1.9 +++ shm-common.h 15 Nov 2013 15:03:18 -0000 @@ -81,14 +81,14 @@ struct ShmCtlBlock { int setup_shmid; }; -inline void sem_wait_lock(int semid, int idx, int flag=0) +inline void sem_wait_lock(int semid, unsigned short idx, short int flag=0) { struct sembuf sem_op = { idx, -1, flag }; semop(semid, &sem_op,1); }; -inline void sem_sig_unlock(int semid, int idx,int flag=0) +inline void sem_sig_unlock(int semid, unsigned short idx, short int flag=0) { struct sembuf sem_op = { idx, 1, flag }; Index: softdevice.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/softdevice.c,v retrieving revision 1.99 diff -p -u -r1.99 softdevice.c --- softdevice.c 17 Apr 2011 17:22:19 -0000 1.99 +++ softdevice.c 15 Nov 2013 15:03:19 -0000 @@ -1306,7 +1306,7 @@ bool cPluginSoftDevice::Service(const ch bool cPluginSoftDevice::Start(void) { // Start any background activities the plugin shall perform. - RegisterI18n(Phrases); + I18nRegister("softdevice"); return true; } Index: sync-timer.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/sync-timer.h,v retrieving revision 1.5 diff -p -u -r1.5 sync-timer.h --- sync-timer.h 25 Mar 2007 08:54:12 -0000 1.5 +++ sync-timer.h 15 Nov 2013 15:03:19 -0000 @@ -39,7 +39,7 @@ class cSigTimer : public cRelTimer { bool got_signal; public: - cSigTimer() : cRelTimer() + cSigTimer() : cRelTimer(), got_signal(false) { pthread_mutex_init(&mutex, NULL); pthread_cond_init(&cond, NULL); Index: video-dfb.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/video-dfb.c,v retrieving revision 1.86 diff -p -u -r1.86 video-dfb.c --- video-dfb.c 14 Jun 2009 18:00:58 -0000 1.86 +++ video-dfb.c 15 Nov 2013 15:03:19 -0000 @@ -183,7 +183,19 @@ static DFBEnumerationResult EnumVideoMod /* --------------------------------------------------------------------------- */ cDFBVideoOut::cDFBVideoOut(cSetupStore *setupStore, cSetupSoftlog *softlog) - : cVideoOut(setupStore, softlog) + : cVideoOut(setupStore, softlog), + osdLayer(0),videoLayer(0),scrDsc(),osdDsc(),vidDsc(), + osdLayerDescription(),videoLayerDescription(),osdLayerConfiguration(), + osdSurface(0),videoSurface(0),scrSurface(0), + pixelformat(),dfbRemote(0),events(0), + deinterlace(false),alphablend(false), + useStretchBlit(false),useSetSourceRectangle(false), + osdClrBack(false),isVIAUnichrome(false), + clearAlpha(0), + clearBackCount(2), // by default for double buffering + clearBackground(0), + prevOsdMode(setupStore->osdMode),videoLayerLevel(1), + dirtyLines(0),tmpOsdSurface(0) { tLayerSelectItem *layerInfo; @@ -195,16 +207,9 @@ cDFBVideoOut::cDFBVideoOut(cSetupStore * swidth = fwidth = 720; sheight = fheight = 576; - tmpOsdSurface = NULL; screenPixelAspect = -1; currentPixelFormat = setupStore->pixelFormat; - prevOsdMode = setupStore->osdMode; setupStore->osdMode = 0; - isVIAUnichrome = false; - clearAlpha = 0x00; - clearBackground = 0; - clearBackCount = 2; // by default for double buffering; - videoLayerLevel = 1; OSDpresent = false; if(setupStore->viaTv) @@ -1054,7 +1059,7 @@ void cDFBVideoOut::SetParams() videoSurface->Release(); } if (setupStore->useMGAtv) { - vidDsc.caps = DFB_ADD_SURFACE_CAPS(vidDsc.caps, DSCAPS_INTERLACED); + DFB_ADD_SURFACE_CAPS(vidDsc.caps, DSCAPS_INTERLACED); } videoSurface=dfb->CreateSurface(vidDsc); @@ -1120,16 +1125,15 @@ void cDFBVideoOut::Pause(void) /* ---------------------------------------------------------------------------- */ -void cDFBVideoOut::OpenOSD () +void cDFBVideoOut::ClearOSD() { - IDirectFBSurface *tmpSurface; - if (!videoInitialized) return; - cVideoOut::OpenOSD(); try { + IDirectFBSurface *tmpSurface; + tmpSurface = (useStretchBlit) ? osdSurface : scrSurface; tmpSurface->Clear(0,0,0,clearAlpha); tmpSurface->Flip(); @@ -1138,7 +1142,7 @@ void cDFBVideoOut::OpenOSD () catch (DFBException *ex) { softlog->Log(SOFT_LOG_ERROR, 0, - "[dfb] OpenOSD: action=%s, result=%s\n", + "[dfb] ClearOSD: action=%s, result=%s\n", ex->GetAction(), ex->GetResult()); delete ex; } @@ -1221,14 +1225,14 @@ void cDFBVideoOut::CommitUnlockOsdSurfac int maxy=0; tmpOsdSurface->SetBlittingFlags(DSBLIT_NOFX); do { - while (!dirtyLines[miny] && miny < Yres) + while (miny < Yres && !dirtyLines[miny]) miny++; if (miny >= Yres) break; maxy=miny; - while (dirtyLines[maxy] && maxy < Yres) + while (maxy < Yres && dirtyLines[maxy]) maxy++; osdsrc.x = 0; @@ -1289,39 +1293,8 @@ bool cDFBVideoOut::IsSoftOSDMode() */ void cDFBVideoOut::CloseOSD() { - IDirectFBSurface *tmpSurface; - - if (!videoInitialized) - return; - + ClearOSD(); cVideoOut::CloseOSD(); - tmpSurface = (useStretchBlit) ? osdSurface : scrSurface; - try - { - if (useStretchBlit) - { - OSDpresent = false; - clearBackground = clearBackCount; - tmpSurface->Clear(COLORKEY,clearAlpha); //clear and - } - else - { - tmpSurface->Clear(COLORKEY,clearAlpha); //clear and - tmpSurface->Flip(); // Flip the field - if (!isVIAUnichrome) - { - tmpSurface->Clear(COLORKEY,clearAlpha); //clear and - tmpSurface->Flip(); // Flip the field - } - } - } - catch (DFBException *ex) - { - softlog->Log(SOFT_LOG_ERROR, 0, - "[dfb] CloseOSD: action=%s, result=%s\n", - ex->GetAction(), ex->GetResult()); - delete ex; - } } /* --------------------------------------------------------------------------- Index: video-dfb.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/video-dfb.h,v retrieving revision 1.30 diff -p -u -r1.30 video-dfb.h --- video-dfb.h 14 Jun 2009 18:00:58 -0000 1.30 +++ video-dfb.h 15 Nov 2013 15:03:19 -0000 @@ -74,7 +74,7 @@ class cDFBVideoOut : public cVideoOut { bool *dirtyLines; IDirectFBSurface *tmpOsdSurface; - virtual void OpenOSD(); + virtual void ClearOSD(); virtual void GetOSDMode(int &Depth, bool &HasAlpha, bool &AlphaInversed, bool &IsYUV); virtual void GetOSDDimension(int &OsdWidth,int &OsdHeight, Index: video-shm.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/video-shm.c,v retrieving revision 1.20 diff -p -u -r1.20 video-shm.c --- video-shm.c 13 Oct 2007 11:17:48 -0000 1.20 +++ video-shm.c 15 Nov 2013 15:03:19 -0000 @@ -238,7 +238,7 @@ void cShmVideoOut::CheckShmIDs() { case PIX_FMT_YUV422: SHMDEB("new format YUV422\n"); privBuf.pixel[0]=curr_pict+ctl->offset0; - privBuf.pixel[1]=privBuf.pixel[1]=NULL; + privBuf.pixel[1]=privBuf.pixel[2]=NULL; privBuf.stride[0]=ctl->stride0; privBuf.stride[1]=privBuf.stride[2]=0; break; Index: video.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/video.c,v retrieving revision 1.80 diff -p -u -r1.80 video.c --- video.c 17 Apr 2011 17:22:19 -0000 1.80 +++ video.c 15 Nov 2013 15:03:20 -0000 @@ -53,6 +53,9 @@ cVideoOut::cVideoOut(cSetupStore *setupS freezeMode=false; videoInitialized = false; oldPicture = NULL; + zoomCenterX = zoomCenterY = 0; + expandTopBottom = expandLeftRight = 0; + frametime = 0; hurryUp = 0; delay = 0; @@ -65,6 +68,7 @@ cVideoOut::cVideoOut(cSetupStore *setupS offsetClampHigh = 2; offsetUse = 1; useAverage4Drop = false; + current_osdMode = OSDMODE_PSEUDO; for (int i = 0; i < SETUP_VIDEOASPECTNAMES_COUNT; ++i) parValues [i] = 1.0; Index: video.h =================================================================== RCS file: /cvsroot/softdevice/softdevice/video.h,v retrieving revision 1.60 diff -p -u -r1.60 video.h --- video.h 17 Apr 2011 17:22:19 -0000 1.60 +++ video.h 15 Nov 2013 15:03:20 -0000 @@ -28,7 +28,7 @@ #define DV_FORMAT_NORMAL 1 #define DV_FORMAT_WIDE 2 -#if VDRVERSNUM <= 10707 +#if 1//VDRVERSNUM <= 10707 #define OSD_FULL_WIDTH 736 #define OSD_FULL_HEIGHT 576