Prevent crash when calling getTime() on an empty DTSC::Stream
This commit is contained in:
parent
1477939924
commit
10e4a78398
1 changed files with 3 additions and 0 deletions
|
@ -34,6 +34,9 @@ void DTSC::Stream::deletionCallback(livePos deleting){}
|
|||
/// Returns the time in milliseconds of the last received packet.
|
||||
/// This is _not_ the time this packet was received, only the stored time.
|
||||
unsigned int DTSC::Stream::getTime(){
|
||||
if ( !buffers.size()){
|
||||
return 0;
|
||||
}
|
||||
return buffers.rbegin()->second["time"].asInt();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue