#include "muxers.h"
#include <gpac/isomedia.h>
+#ifdef HAVE_GF_MALLOC
+#undef malloc
+#undef free
+#define malloc gf_malloc
+#define free gf_free
+#endif
+
typedef struct
{
GF_ISOFile *p_file;
GF_ISOSample *p_sample;
int i_track;
uint32_t i_descidx;
- int i_time_res;
+ uint32_t i_time_res;
int64_t i_time_inc;
int i_numframe;
int i_delay_time;
static void recompute_bitrate_mp4( GF_ISOFile *p_file, int i_track )
{
- u32 i, count, di, timescale, time_wnd, rate;
+ u32 count, di, timescale, time_wnd, rate;
u64 offset;
Double br;
GF_ESD *esd;
timescale = gf_isom_get_media_timescale( p_file, i_track );
count = gf_isom_get_sample_count( p_file, i_track );
- for( i = 0; i < count; i++ )
+ for( int i = 0; i < count; i++ )
{
GF_ISOSample *samp = gf_isom_get_sample_info( p_file, i_track, i+1, &di, &offset );
if( !samp )
* So, if mdhd duration is equal to the last DTS or less, we give the last composition time delta to the last sample duration.
* And then, the mdhd duration is updated, but it time-wise doesn't give the actual duration.
* The tkhd duration is the actual track duration. */
- uint64_t mdhd_duration = (2 * largest_pts - second_largest_pts - p_mp4->i_delay_time) * p_mp4->i_time_inc;
+ uint64_t mdhd_duration = (2 * largest_pts - second_largest_pts) * p_mp4->i_time_inc;
if( mdhd_duration != gf_isom_get_media_duration( p_mp4->p_file, p_mp4->i_track ) )
{
uint64_t last_dts = gf_isom_get_sample_dts( p_mp4->p_file, p_mp4->i_track, p_mp4->i_numframe );