Commit 341edf5e authored by Laurent Aimar's avatar Laurent Aimar

* all: added support for edts/elst entries (needed to play some files).

 Please test, it may have heavily broken playback of some files !!!
parent c8ac42bf
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc * libmp4.c : LibMP4 library for mp4 module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.43 2004/01/09 04:37:43 jlj Exp $ * $Id: libmp4.c,v 1.44 2004/01/18 22:00:00 fenrir Exp $
* *
* Author: Laurent Aimar <fenrir@via.ecp.fr> * Author: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1559,7 +1559,7 @@ static int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1559,7 +1559,7 @@ static int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_elst->i_segment_duration = p_box->data.p_elst->i_segment_duration =
calloc( sizeof( uint64_t ), p_box->data.p_elst->i_entry_count ); calloc( sizeof( uint64_t ), p_box->data.p_elst->i_entry_count );
p_box->data.p_elst->i_media_time = p_box->data.p_elst->i_media_time =
calloc( sizeof( uint64_t ), p_box->data.p_elst->i_entry_count ); calloc( sizeof( int64_t ), p_box->data.p_elst->i_entry_count );
p_box->data.p_elst->i_media_rate_integer = p_box->data.p_elst->i_media_rate_integer =
calloc( sizeof( uint16_t ), p_box->data.p_elst->i_entry_count ); calloc( sizeof( uint16_t ), p_box->data.p_elst->i_entry_count );
p_box->data.p_elst->i_media_rate_fraction= p_box->data.p_elst->i_media_rate_fraction=
...@@ -1581,6 +1581,7 @@ static int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1581,6 +1581,7 @@ static int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES( p_box->data.p_elst->i_segment_duration[i] ); MP4_GET4BYTES( p_box->data.p_elst->i_segment_duration[i] );
MP4_GET4BYTES( p_box->data.p_elst->i_media_time[i] ); MP4_GET4BYTES( p_box->data.p_elst->i_media_time[i] );
p_box->data.p_elst->i_media_time[i] = (int32_t)p_box->data.p_elst->i_media_time[i];
} }
MP4_GET2BYTES( p_box->data.p_elst->i_media_rate_integer[i] ); MP4_GET2BYTES( p_box->data.p_elst->i_media_rate_integer[i] );
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.h : MP4 file input module for vlc * mp4.h : MP4 file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mp4.h,v 1.12 2004/01/18 18:31:50 fenrir Exp $ * $Id: mp4.h,v 1.13 2004/01/18 22:00:00 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -66,6 +66,11 @@ typedef struct ...@@ -66,6 +66,11 @@ typedef struct
/* more internal data */ /* more internal data */
uint64_t i_timescale; /* time scale for this track only */ uint64_t i_timescale; /* time scale for this track only */
/* elst */
int i_elst; /* current elst */
int64_t i_elst_time; /* current elst start time (in movie time scale)*/
MP4_Box_t *p_elst; /* elst (could be NULL) */
/* give the next sample to read, i_chunk is to find quickly where /* give the next sample to read, i_chunk is to find quickly where
the sample is located */ the sample is located */
uint32_t i_sample; /* next sample to read */ uint32_t i_sample; /* next sample to read */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment