diff --git a/av/frame.pyx b/av/frame.pyx index b98624cc5..352b68157 100644 --- a/av/frame.pyx +++ b/av/frame.pyx @@ -75,6 +75,12 @@ cdef class Frame: return None return self.ptr.pkt_dts + def __set__(self, value): + if value is None: + self.ptr.pkt_dts = lib.AV_NOPTS_VALUE + else: + self.ptr.pkt_dts = value + property pts: """ The presentation timestamp in :attr:`time_base` units for this frame. diff --git a/av/packet.pyx b/av/packet.pyx index 0687b2237..af77e2c10 100644 --- a/av/packet.pyx +++ b/av/packet.pyx @@ -196,5 +196,17 @@ cdef class Packet(Buffer): property is_keyframe: def __get__(self): return bool(self.ptr.flags & lib.AV_PKT_FLAG_KEY) + def __set__(self, v): + if v: + self.ptr.flags |= lib.AV_PKT_FLAG_KEY + else: + self.ptr.flags &= ~(lib.AV_PKT_FLAG_KEY) + property is_corrupt: def __get__(self): return bool(self.ptr.flags & lib.AV_PKT_FLAG_CORRUPT) + + def __set__(self, v): + if v: + self.ptr.flags |= lib.AV_PKT_FLAG_CORRUPT + else: + self.ptr.flags &= ~(lib.AV_PKT_FLAG_CORRUPT)