Skip to content

Commit

Permalink
# ver. 0.9.3.6
Browse files Browse the repository at this point in the history
# xy-VSSppf 0.1.2.2
* bugfix: crashed at transparent subtitle frames
  • Loading branch information
subelf committed May 6, 2016
1 parent 8e0ac90 commit d7226e9
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 10 deletions.
Binary file modified Spp2Pgs/res/Spp2Pgs.rc
Binary file not shown.
Binary file modified Spp2PgsNet/res/app.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion libspp2pgs/inc/BgraFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace spp2pgs

int ReadNextOf(FrameStream * stream);

inline int GetFrameIndex() { return this->index; }
inline int GetFrameIndex() const { return this->index; }

bool IsIdenticalTo(BgraFrame *frame);
bool IsBlank();
Expand Down
2 changes: 1 addition & 1 deletion libspp2pgs/inc/StillImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace spp2pgs
void Erase(Rect const& rect) { this->ExplicitErase(rect); };

void RegisterRrawnRects(Rect const& rect) {
AnnounceDirty();
AnnounceModified();
this->drawnRects.push_back(rect);
}

Expand Down
Binary file modified libspp2pgs/res/libspp2pgs.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion libspp2pgs/src/BgraSubPicStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace spp2pgs
if (SUCCEEDED(hr))
{
bgraImage->AnnounceModified();
bgraImage->AnnounceNormalized();
bgraImage->AnnounceNonNormalized();
if (isAnnouncedBlank == 0)
{
bgraImage->AnnounceDirty();
Expand Down
12 changes: 7 additions & 5 deletions libspp2pgs/src/SppAdvisor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ int SppAdvisor::IsBlank(int index) const

if (seg == sq.end() || (*seg).b > iIndex) return 1; //beyond the end or outside of segments

if ((*seg).b <= iIndex && !(*seg).a) return 0; //inside of a static segment
//if ((*seg).b <= iIndex && !(*seg).a) return 0; //inside of a static segment //may be alpha==&HFF&

return -1;
}

int SppAdvisor::IsIdentical(int index1, int index2) const
{
if (index1 == index2) return 1;

int const &iIndex1 = index1 - this->offset;
int const &iIndex2 = index2 - this->offset;

Expand All @@ -127,15 +129,15 @@ int SppAdvisor::IsIdentical(int index1, int index2) const
{
auto const& seg1 = std::lower_bound(sq.begin(), sq.end(), iIndex1, cmp);
if (seg1 == sq.end() || (*seg1).b > iIndex1) blank1 = 1; //beyond the end or outside of segments
if ((*seg1).b <= iIndex1 && !(*seg1).a) blank1 = 0;
if ((*seg1).b <= iIndex1) blank1 = -2;

auto const& seg2 = std::lower_bound(sq.begin(), sq.end(), iIndex2, cmp);
if (seg2 == sq.end() || (*seg2).b > iIndex2) blank2 = 1;
if ((*seg2).b <= iIndex2 && !(*seg2).a) blank2 = 0;
if ((*seg2).b <= iIndex2) blank2 = -2;

if (blank1 == 1 && blank2 == 1) return 1; //[1, 1], both are blank img
if (blank1 + blank2 == 1) return 0; //[0, 1] or [1, 0], different
if (blank1 == 0 && blank2 == 0 && seg1 == seg2) //inside the same static segment
//if (blank1 + blank2 == 1) return 0; //[0, 1] or [1, 0], different
if (seg1 == seg2 && blank1 + blank2 == -4 && !(*seg1).a) //inside the same static segment
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion libspp2pgs/src/StillImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace spp2pgs
return;

ExplicitEraseTransparents();
InvalidateRrawnRects();
//InvalidateRrawnRects();
this->isNormalized = true;
}
}
2 changes: 1 addition & 1 deletion misc/xy-VSFilter/src

0 comments on commit d7226e9

Please sign in to comment.