mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Fix missing images in bdsup - thx Devin :)
Multi images would be merged if only first image was the same
This commit is contained in:
parent
a467164c1e
commit
40973b62d5
@ -829,6 +829,7 @@ namespace Nikse.SubtitleEdit.Core.BluRaySup
|
||||
}
|
||||
}
|
||||
|
||||
// merge images that are the same (probably due to fade)
|
||||
for (int pcsIndex = pcsList.Count - 1; pcsIndex > 0; pcsIndex--)
|
||||
{
|
||||
var cur = pcsList[pcsIndex];
|
||||
@ -836,14 +837,39 @@ namespace Nikse.SubtitleEdit.Core.BluRaySup
|
||||
if (Math.Abs(prev.EndTime - cur.StartTime) < 10 && prev.Size.Width == cur.Size.Width && prev.Size.Height == cur.Size.Height)
|
||||
{
|
||||
if (cur.BitmapObjects.Count > 0 && cur.BitmapObjects[0].Count > 0 &&
|
||||
prev.BitmapObjects.Count > 0 && prev.BitmapObjects[0].Count > 0 &&
|
||||
ByteArraysEqual(cur.BitmapObjects[0][0].Fragment.ImageBuffer, prev.BitmapObjects[0][0].Fragment.ImageBuffer))
|
||||
prev.BitmapObjects.Count == cur.BitmapObjects.Count && prev.BitmapObjects[0].Count == cur.BitmapObjects[0].Count)
|
||||
{
|
||||
var remove = true;
|
||||
for (int k = 0; k < cur.BitmapObjects.Count; k++)
|
||||
{
|
||||
var c = cur.BitmapObjects[k];
|
||||
var p = prev.BitmapObjects[k];
|
||||
if (p.Count == c.Count)
|
||||
{
|
||||
for (int j = 0; j < c.Count; j++)
|
||||
{
|
||||
if (!ByteArraysEqual(c[j].Fragment.ImageBuffer, p[j].Fragment.ImageBuffer))
|
||||
{
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (remove)
|
||||
{
|
||||
prev.EndTime = cur.EndTime;
|
||||
pcsList.RemoveAt(pcsIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// save last palette
|
||||
if (lastPalettes != null && palettes.Count > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user