|
0 |
From 7c2004b58c26da661618262c9c06b73ad3a9ff6c Mon Sep 17 00:00:00 2001
|
|
1 |
From: "A. David" <aurelien.david@telecom-paristech.fr>
|
|
2 |
Date: Thu, 2 Jul 2020 19:45:50 +0200
|
|
3 |
Subject: mp4: Update GPAC support to v0.8.0 or later
|
|
4 |
|
|
5 |
---
|
|
6 |
configure | 5 +++--
|
|
7 |
output/mp4.c | 6 +++++-
|
|
8 |
2 files changed, 8 insertions(+), 3 deletions(-)
|
|
9 |
|
|
10 |
Index: x264-0.160.3011+gitcde9a93/configure
|
|
11 |
===================================================================
|
|
12 |
--- x264-0.160.3011+gitcde9a93.orig/configure
|
|
13 |
+++ x264-0.160.3011+gitcde9a93/configure
|
|
14 |
@@ -1240,15 +1240,16 @@ if [ "$gpac" = "auto" -a "$lsmash" != "y
|
|
15 |
gpac="no"
|
|
16 |
GPAC_LIBS="-lgpac"
|
|
17 |
cc_check "" -lz && GPAC_LIBS="$GPAC_LIBS -lz"
|
|
18 |
+ cc_check "" -ldl && GPAC_LIBS="$GPAC_LIBS -ldl"
|
|
19 |
if [ "$SYS" = "WINDOWS" ] ; then
|
|
20 |
cc_check "" -lws2_32 && GPAC_LIBS="$GPAC_LIBS -lws2_32"
|
|
21 |
cc_check "" -lwinmm && GPAC_LIBS="$GPAC_LIBS -lwinmm"
|
|
22 |
fi
|
|
23 |
if cc_check gpac/isomedia.h "$GPAC_LIBS" "gf_isom_close(0);" ; then
|
|
24 |
- if cc_check gpac/isomedia.h "$GPAC_LIBS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
|
|
25 |
+ if cc_check gpac/isomedia.h "$GPAC_LIBS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0,0);" ; then
|
|
26 |
gpac="yes"
|
|
27 |
else
|
|
28 |
- echo "Warning: gpac is too old, update to 2007-06-21 UTC or later"
|
|
29 |
+ echo "Warning: gpac is too old, update to v0.8.0 or later"
|
|
30 |
fi
|
|
31 |
fi
|
|
32 |
fi
|
|
33 |
Index: x264-0.160.3011+gitcde9a93/output/mp4.c
|
|
34 |
===================================================================
|
|
35 |
--- x264-0.160.3011+gitcde9a93.orig/output/mp4.c
|
|
36 |
+++ x264-0.160.3011+gitcde9a93/output/mp4.c
|
|
37 |
@@ -147,7 +147,11 @@ static int close_file( hnd_t handle, int
|
|
38 |
{
|
|
39 |
uint32_t mvhd_timescale = gf_isom_get_timescale( p_mp4->p_file );
|
|
40 |
uint64_t tkhd_duration = (uint64_t)( mdhd_duration * ( (double)mvhd_timescale / p_mp4->i_time_res ) );
|
|
41 |
+#if GPAC_VERSION_MAJOR > 8
|
|
42 |
+ gf_isom_append_edit( p_mp4->p_file, p_mp4->i_track, tkhd_duration, sample->CTS_Offset, GF_ISOM_EDIT_NORMAL );
|
|
43 |
+#else
|
|
44 |
gf_isom_append_edit_segment( p_mp4->p_file, p_mp4->i_track, tkhd_duration, sample->CTS_Offset, GF_ISOM_EDIT_NORMAL );
|
|
45 |
+#endif
|
|
46 |
}
|
|
47 |
gf_isom_sample_del( &sample );
|
|
48 |
|
|
49 |
@@ -233,7 +237,7 @@ static int set_param( hnd_t handle, x264
|
|
50 |
dw *= sar;
|
|
51 |
else
|
|
52 |
dh /= sar;
|
|
53 |
- gf_isom_set_pixel_aspect_ratio( p_mp4->p_file, p_mp4->i_track, p_mp4->i_descidx, p_param->vui.i_sar_width, p_param->vui.i_sar_height );
|
|
54 |
+ gf_isom_set_pixel_aspect_ratio( p_mp4->p_file, p_mp4->i_track, p_mp4->i_descidx, p_param->vui.i_sar_width, p_param->vui.i_sar_height, 0 );
|
|
55 |
gf_isom_set_track_layout_info( p_mp4->p_file, p_mp4->i_track, dw, dh, 0, 0, 0 );
|
|
56 |
}
|
|
57 |
|