mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 11:42:36 +01:00
Fix repeating of last image sub
This commit is contained in:
parent
b687247fec
commit
125cf52fc8
@ -142,10 +142,12 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
|||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var pid in SubtitlePackets.Select(p => p.PacketId))
|
foreach (var pid in SubtitlePackets.GroupBy(p => p.PacketId))
|
||||||
{
|
{
|
||||||
firstMs = ProcessPackages(pid, teletextPages, teletextPesList, firstMs);
|
firstMs = ProcessPackages(pid.Key, teletextPages, teletextPesList, firstMs);
|
||||||
}
|
}
|
||||||
|
SubtitlePackets.Clear();
|
||||||
|
|
||||||
|
|
||||||
foreach (var packetId in teletextPesList.Keys) // teletext from PES packets
|
foreach (var packetId in teletextPesList.Keys) // teletext from PES packets
|
||||||
{
|
{
|
||||||
@ -236,39 +238,11 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for SubPictureStreamId = 32
|
|
||||||
foreach (int pid in SubtitlePacketIds)
|
|
||||||
{
|
|
||||||
var list = MakeSubtitlePesPackets(pid, SubtitlePackets);
|
|
||||||
bool hasImageSubtitles = false;
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
if (item.IsDvbSubPicture)
|
|
||||||
{
|
|
||||||
hasImageSubtitles = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasImageSubtitles)
|
|
||||||
{
|
|
||||||
if (SubtitlesLookup.ContainsKey(pid))
|
|
||||||
{
|
|
||||||
SubtitlesLookup[pid].AddRange(list);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SubtitlesLookup.Add(pid, list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SubtitlePackets.RemoveAll(p => p.PacketId == pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
SubtitlePacketIds.Clear();
|
SubtitlePacketIds.Clear();
|
||||||
foreach (int key in SubtitlesLookup.Keys)
|
foreach (int key in SubtitlesLookup.Keys)
|
||||||
{
|
{
|
||||||
SubtitlePacketIds.Add(key);
|
SubtitlePacketIds.Add(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
SubtitlePacketIds.Sort();
|
SubtitlePacketIds.Sort();
|
||||||
|
|
||||||
// Merge packets and set start/end time
|
// Merge packets and set start/end time
|
||||||
|
Loading…
Reference in New Issue
Block a user