Skip to content

Commit

Permalink
MpegSplitter: Игнорируемым пустой некорректный блок в начале VOB-файлов.
Browse files Browse the repository at this point in the history
Обычно это один "кадр-пустышка" (используется для навигацию по DVD), у которого время сильно отличается от последующих блоков.
  • Loading branch information
v0lt committed Jul 2, 2022
1 parent b3d08a9 commit 45736f2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
Expand Up @@ -188,6 +188,19 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
}
SearchStreams(0, stop);

if (m_type == MPEG_TYPES::mpeg_ps) {
// ignoring wrong empty block at the beginning of some VOB files
for (auto& [track_num, sps] : m_SyncPoints) {
if (sps.size() > 2) {
auto dur0 = sps[1].rt - sps[0].rt;
auto dur1 = sps[2].rt - sps[1].rt;
if (dur0 > dur1 * 1000) {
sps.erase(sps.begin());
}
}
}
}

const int step_size = 512 * KILOBYTE;

int num = std::min(steps, (len - stop) / step_size);
Expand Down

0 comments on commit 45736f2

Please sign in to comment.