Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix DVBSub: the subtitles color was incorrect:

- entry_id +1 caused incorrect color index
- transparency was clear when Y = 0 causing pink/green edge.
Patch by s4e.

git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4692 10f7b99b-c216-0410-bff0-8a66a9350fd8
  • Loading branch information...
commit bc9dcc244163adfa916876f57d6693810e69d982 1 parent e380035
underground78 authored
Showing with 8 additions and 3 deletions.
  1. +1 −0  docs/Changelog.txt
  2. +7 −3 src/Subtitles/DVBSub.cpp
1  docs/Changelog.txt
View
@@ -92,6 +92,7 @@ Legend:
! The Windows 7 taskbar was sometimes not correctly updated (for example when opening
another video without closing the previous one). The preview was incorrectly cropped
when the menu was hidden.
+! Fix DVBSub: the subtitles' color was incorrect
! Ticket #869, The playlist visibility state was incorrectly restored when MPC-HC
was quited in fullscreen mode while the option "Hide on fullscreen" was enabled
! Ticket #1182, Unable to playback MPEG-2 in AVI
10 src/Subtitles/DVBSub.cpp
View
@@ -512,7 +512,7 @@ HRESULT CDVBSub::ParseClut(CGolombBuffer& gb, WORD wSegLength)
pClut->Size = 0;
while (gb.GetPos() < wEnd) {
- BYTE entry_id = gb.ReadByte()+1;
+ BYTE entry_id = gb.ReadByte();
BYTE _2_bit = (BYTE)gb.BitRead(1);
BYTE _4_bit = (BYTE)gb.BitRead(1);
BYTE _8_bit = (BYTE)gb.BitRead(1);
@@ -534,10 +534,14 @@ HRESULT CDVBSub::ParseClut(CGolombBuffer& gb, WORD wSegLength)
pClut->Palette[entry_id].T = 0xff-((BYTE)gb.BitRead(2)<<6);
}
if (!pClut->Palette[entry_id].Y) {
- pClut->Palette[entry_id].Cr = pClut->Palette[entry_id].Cb = 0;
+ pClut->Palette[entry_id].Cr = 0;
+ pClut->Palette[entry_id].Cb = 0;
+ pClut->Palette[entry_id].T = 0;
}
- pClut->Size = max (pClut->Size, entry_id);
+ if (pClut->Size <= entry_id) {
+ pClut->Size = entry_id+1;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.