Fix MistProcMKVExec segfault

This commit is contained in:
Thulinma 2024-01-30 22:44:43 +01:00
parent 470e4fc631
commit 8fd4f29b06

View file

@ -48,7 +48,7 @@ namespace Mist{
} }
if (config->getString("target").find(".webm") != std::string::npos){doctype = "webm";} if (config->getString("target").find(".webm") != std::string::npos){doctype = "webm";}
initialize(); initialize();
if (!M.getLive()){calcVodSizes();} if (M && !M.getLive()){calcVodSizes();}
} }
} }
@ -503,6 +503,7 @@ namespace Mist{
return; return;
} }
size_t idx = getMainSelectedTrack(); size_t idx = getMainSelectedTrack();
if (idx == INVALID_TRACK_ID){return;}
double duration = M.getLastms(idx) - M.getFirstms(idx); double duration = M.getLastms(idx) - M.getFirstms(idx);
// Calculate the segment size // Calculate the segment size
// Segment contains SeekHead, Info, Tracks, Cues (in that order) // Segment contains SeekHead, Info, Tracks, Cues (in that order)