Skip to content

Commit

Permalink
Partial fix for VOBSUB with alpha not being displayed
Browse files Browse the repository at this point in the history
Backport of MPC-BE commit 1459
  • Loading branch information
Cyberbeing committed Dec 6, 2014
1 parent b14a78f commit f3a834d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/subtitles/VobSubImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ bool CVobSubImage::Decode(BYTE* lpData, int packetsize, int datasize,
int end0 = nOffset[1];
int end1 = datasize;

// fixme: support vobsub animation
if (nOffset[0] > nOffset[1]) {
end1 = nOffset[0];
end0 = datasize;
}

while((nPlane == 0 && nOffset[0] < end0) || (nPlane == 1 && nOffset[1] < end1))
{
DWORD code;
Expand Down Expand Up @@ -186,7 +192,11 @@ void CVobSubImage::GetPacketInfo(BYTE* lpData, int packetsize, int datasize)
pal = (lpData[i] << 8) | lpData[i+1]; i += 2;
break;
case 0x04:
tr = (lpData[i] << 8) | lpData[i+1]; i += 2;
if (lpData[i] || lpData[i+1]) {
tr = (lpData[i] << 8) | lpData[i+1];
}

i += 2;
//tr &= 0x00f0;
break;
case 0x05:
Expand Down

0 comments on commit f3a834d

Please sign in to comment.