[vlc-devel] [PATCH] mux:mp4: fix 32 bits written where it should be 64
Zhao Zhili
quinkblack at foxmail.com
Thu Sep 20 08:42:09 CEST 2018
On 2018年09月20日 13:50, Steve Lhomme wrote:
> I don't have the spec, but I thought that there was a mode in 32 bits
> (above in the !b_64_ext) and one (extended) in 64 bits. But maybe
> they're odd like that.
>
It looks a bit odd, but reasonable after a second thought. Since
timescale is a scale factor, it doesn't need to hold a large value as
duration.
aligned(8) class MediaHeaderBox extends FullBox(‘mdhd’, version, 0) {
if (version==1) {
unsigned int(64) creation_time;
unsigned int(64) modification_time;
unsigned int(32) timescale;
unsigned int(64) duration;
} else { // version==0
unsigned int(32) creation_time;
unsigned int(32) modification_time;
unsigned int(32) timescale;
unsigned int(32) duration;
}
bit(1)
pad = 0;
unsigned int(5)[3] language; // ISO-639-2/T language code
unsigned int(16) pre_defined = 0;
}
>
> On 20/09/2018 05:28, Zhao Zhili wrote:
>>
>>
>> On 2018年09月19日 20:37, Steve Lhomme wrote:
>>> ---
>>> modules/mux/mp4/libmp4mux.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
>>> index 92e7b1fe322..7d4d2fb8ad5 100644
>>> --- a/modules/mux/mp4/libmp4mux.c
>>> +++ b/modules/mux/mp4/libmp4mux.c
>>> @@ -1600,7 +1600,7 @@ bo_t * mp4mux_GetMoovBox(vlc_object_t *p_obj,
>>> mp4mux_trackinfo_t **pp_tracks, un
>>> }
>>> bo_add_64be(mdhd, i_timestamp); // creation time
>>> bo_add_64be(mdhd, i_timestamp); // modification time
>>> - bo_add_32be(mdhd, p_stream->i_timescale); // timescale
>>> + bo_add_64be(mdhd, p_stream->i_timescale); // timescale
>>
>> ISO/IEC 14496-12:2005(E) 8.8.2 says it's unsigned int(32). Would you
>> mind share some details why it should be 64?
>>
>>> bo_add_64be(mdhd, i_stream_duration *
>>> p_stream->i_timescale / i_movie_timescale); // duration
>>> }
>>
>>
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list