From patchwork Wed Mar 30 21:16:57 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ville_Skytt=C3=A4?= X-Patchwork-Id: 11838 Received: from smtp2.pp.htv.fi ([213.243.153.35]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DGkYP-0002hg-0a for vdr@linuxtv.org; Wed, 30 Mar 2005 23:16:45 +0200 Received: from cs78130200.pp.htv.fi (cs78130200.pp.htv.fi [62.78.130.200]) by smtp2.pp.htv.fi (Postfix) with ESMTP id 630C7296B47 for ; Thu, 31 Mar 2005 00:16:58 +0300 (EEST) Subject: Re: [vdr] Patch: dxr3plugin OSD don't turn pink From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: vdr@linuxtv.org In-Reply-To: <424A9224.4000608@compuserve.de> References: <424A9224.4000608@compuserve.de> Date: Thu, 31 Mar 2005 00:16:57 +0300 Message-Id: <1112217417.31596.17.camel@bobcat.mine.nu> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-2) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 21:16:45 -0000 Status: O X-Status: X-Keywords: X-UID: 1282 On Wed, 2005-03-30 at 13:48 +0200, Martin Cap wrote: > Attached to this posting is a patch which fixes the odd problem making > the osd > turn pink after returning from mplayer or after hardware-reset of the > dxr3-card. > I posted this fix in a german-vdr-forum a couple of months ago and it > works for other users there, too. I haven't found the time to post it > here (other users hadn't either:) )... so, > here it is. Yep, works for me too, thanks. However, the patch gave me the creeps, so I dug a little deeper. I found that the only thing needed to fix the pink OSD here was to comment out the "m_users[i] == 0" test in AddColor() and unconditionally setting m_changed to true there, or to set it to true in GetIndex() when the color was found. Both of those were still ugly. Then I noticed that the counters in m_users were not being reset to zero when they IMO should have been, and came up with the attached patch which I think would be more appropriate. (Also applied to the vdr-dxr3-0-2 branch in CVS.) With this one applied, I no longer get pink OSD after returning from the MPlayer plugin. But after "Reset DXR3", the OSD is still momentarily pink immediately after; things return to normal when the OSD is hidden/shown again. Reviews/testing welcome... Index: dxr3interface_spu_encoder.c =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/Attic/dxr3interface_spu_encoder.c,v retrieving revision 1.1.2.5 diff -u -U2 -r1.1.2.5 dxr3interface_spu_encoder.c --- dxr3interface_spu_encoder.c 30 Mar 2005 20:18:13 -0000 1.1.2.5 +++ dxr3interface_spu_encoder.c 30 Mar 2005 21:05:40 -0000 @@ -450,4 +450,5 @@ // This should be done in cSPUEncoder::cSPUEncoder + m_palManager.Clear(); return 0; break; Index: dxr3palettemanager.c =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/dxr3palettemanager.c,v retrieving revision 1.1.2.2 diff -u -U2 -r1.1.2.2 dxr3palettemanager.c --- dxr3palettemanager.c 30 Mar 2005 20:34:26 -0000 1.1.2.2 +++ dxr3palettemanager.c 30 Mar 2005 21:05:41 -0000 @@ -114,2 +114,8 @@ return m_pal; } + +// ================================== +void cDxr3PaletteManager::Clear() +{ + memset(m_users, 0, sizeof(int) * MAX_COLORS); +} Index: dxr3palettemanager.h =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/dxr3palettemanager.h,v retrieving revision 1.1 diff -u -U2 -r1.1 dxr3palettemanager.h --- dxr3palettemanager.h 5 Aug 2004 23:05:21 -0000 1.1 +++ dxr3palettemanager.h 30 Mar 2005 21:05:41 -0000 @@ -23,4 +23,5 @@ void AddColor(int color); void RemoveColor(int color); + void Clear(); int GetCount(); int operator[](int index);