From aeec0f8557b77d12c6e85d7bd5d525ea53cbd748 Mon Sep 17 00:00:00 2001 From: Matt Crane Date: Thu, 12 Oct 2023 12:09:24 -0400 Subject: [PATCH] Default VmhdBox flags to 1 to fix Android H.264 playback issues. --- src/mp4box/vmhd.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mp4box/vmhd.rs b/src/mp4box/vmhd.rs index 31f24b2..c7ec8e3 100644 --- a/src/mp4box/vmhd.rs +++ b/src/mp4box/vmhd.rs @@ -4,7 +4,7 @@ use std::io::{Read, Seek, Write}; use crate::mp4box::*; -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct VmhdBox { pub version: u8, pub flags: u32, @@ -29,6 +29,17 @@ impl VmhdBox { } } +impl Default for VmhdBox { + fn default() -> Self { + Self { + version: 0, + flags: 1, + graphics_mode: 0, + op_color: RgbColor::default(), + } + } +} + impl Mp4Box for VmhdBox { fn box_type(&self) -> BoxType { self.get_type()