diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2018-02-24 18:07:16 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2018-02-24 18:35:30 +0100 |
commit | 88e9abd4b69419cfa83093a1e4aee3066b90bcea (patch) | |
tree | a5ccdf733035116aa95c43ebd887c9c7475470d9 /src | |
parent | fd0e41ae0bc0c7b22f9534c38ed7373d86d55a3d (diff) | |
download | nihav-88e9abd4b69419cfa83093a1e4aee3066b90bcea.tar.gz |
h263: fix timestamp difference calculcation
Diffstat (limited to 'src')
-rw-r--r-- | src/codecs/h263/decoder.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codecs/h263/decoder.rs b/src/codecs/h263/decoder.rs index 85d9eea..a7768ea 100644 --- a/src/codecs/h263/decoder.rs +++ b/src/codecs/h263/decoder.rs @@ -208,7 +208,8 @@ impl H263BaseDecoder { } let is_b = pinfo.mode == Type::B; - let tsdiff = pinfo.ts.wrapping_sub(self.last_ts) >> 1; + let tsdiff = if pinfo.is_pb() { pinfo.ts.wrapping_sub(self.last_ts) >> 1 } + else { self.last_ts.wrapping_sub(self.next_ts) >> 1 }; let bsdiff = if pinfo.is_pb() { (pinfo.get_pbinfo().get_trb() as u16) << 7 } else { pinfo.ts.wrapping_sub(self.next_ts) >> 1 }; |