aboutsummaryrefslogtreecommitdiffstats
path: root/src/hap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/hap.zig')
-rw-r--r--src/hap.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hap.zig b/src/hap.zig
index 073cb8b..7b45799 100644
--- a/src/hap.zig
+++ b/src/hap.zig
@@ -76,7 +76,7 @@ pub const HAPDecoder = struct {
}
}
- fn processNextFrame(decoder: *ffmpeg.Decoder, texture: ?*const gl.Texture, z: i32) ffmpeg.Errors!void {
+ fn processNextFrame(decoder: *ffmpeg.Decoder, texture: ?*const gl.Texture, z: i32) ffmpeg.Errors!?f64 {
const self: *HAPDecoder = @fieldParentPtr("decoder", decoder);
try self.decoder.getNextPacket();
@@ -132,6 +132,11 @@ pub const HAPDecoder = struct {
};
}
}
+
+ const pts: f64 = @floatFromInt(packet.*.pts);
+ return pts * c.av_q2d(self.decoder.stream.*.time_base);
}
+
+ return null;
}
};