The audio duration seems to change when remuxing an MKV file to MP4.

[Sample](https://github.com/gpac/gpac/files/10442010/minisample.zip) (borrowed from gpac/gpac#2380).
Tested with gpac bbca869177585aaca8eb66d8541079e6f364798e on macOS 12.6.2

Command: `MP4Box -new -brand mp42 -ab dby1 -add minisample.mkv minisample.mp4`

MKV MediaInfo (audio):

```
Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : A_EAC3
Duration                                 : 9 s 120 ms
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : 16 ms
Stream size                              : 855 KiB (5%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
```

MP4 Mediainfo (audio):

```
Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : ec-3
Duration                                 : 10 s 607 ms
Source duration                          : 10 s 592 ms
Source_Duration_LastFrame                : 1 s 504 ms
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Maximum bit rate                         : 811 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 993 KiB (6%)
Source stream size                       : 852 KiB (5%)
Title                                    : mkv@GPAC2.3-DEV-rev35-gbbca86917-master
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2023-01-20 11:34:32
Tagged date                              : UTC 2023-01-20 11:34:32
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
```

There's also a slight change in the video duration:

MKV Mediainfo (video):

```
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@Main
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 9 s 125 ms
Bit rate                                 : 14.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.071
Stream size                              : 15.4 MiB (95%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 756 cd/m2
Maximum Frame-Average Light Level        : 115 cd/m2
```

MP4 Mediainfo (video):

```
Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@Main
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 9 s 123 ms
Source duration                          : 9 s 121 ms
Bit rate                                 : 14.2 Mb/s
Maximum bit rate                         : 19.6 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 24.000 FPS
Minimum frame rate                       : 23.810 FPS
Maximum frame rate                       : 24.390 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.071
Stream size                              : 15.4 MiB (95%)
Source stream size                       : 15.4 MiB (95%)
Title                                    : mkv@GPAC2.3-DEV-rev35-gbbca86917-master
Language                                 : English
Encoded date                             : UTC 2023-01-20 11:34:32
Tagged date                              : UTC 2023-01-20 11:34:32
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 756 cd/m2
Maximum Frame-Average Light Level        : 115 cd/m2
mdhd_Duration                            : 9205
Codec configuration box                  : hvcC+dvvC
```
Track duration changes when remuxing from mkv to mp4
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Track duration changes when remuxing from mkv to mp4
Issue date:

--- start body ---
The audio duration seems to change when remuxing an MKV file to MP4.

[Sample](https://github.com/gpac/gpac/files/10442010/minisample.zip) (borrowed from gpac/gpac#2380).
Tested with gpac bbca869177585aaca8eb66d8541079e6f364798e on macOS 12.6.2

Command: `MP4Box -new -brand mp42 -ab dby1 -add minisample.mkv minisample.mp4`

MKV MediaInfo (audio):

```
Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : A_EAC3
Duration                                 : 9 s 120 ms
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : 16 ms
Stream size                              : 855 KiB (5%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
```

MP4 Mediainfo (audio):

```
Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : ec-3
Duration                                 : 10 s 607 ms
Source duration                          : 10 s 592 ms
Source_Duration_LastFrame                : 1 s 504 ms
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Maximum bit rate                         : 811 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 993 KiB (6%)
Source stream size                       : 852 KiB (5%)
Title                                    : mkv@GPAC2.3-DEV-rev35-gbbca86917-master
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2023-01-20 11:34:32
Tagged date                              : UTC 2023-01-20 11:34:32
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
```

There's also a slight change in the video duration:

MKV Mediainfo (video):

```
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@Main
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 9 s 125 ms
Bit rate                                 : 14.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.071
Stream size                              : 15.4 MiB (95%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 756 cd/m2
Maximum Frame-Average Light Level        : 115 cd/m2
```

MP4 Mediainfo (video):

```
Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@Main
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 9 s 123 ms
Source duration                          : 9 s 121 ms
Bit rate                                 : 14.2 Mb/s
Maximum bit rate                         : 19.6 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 24.000 FPS
Minimum frame rate                       : 23.810 FPS
Maximum frame rate                       : 24.390 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.071
Stream size                              : 15.4 MiB (95%)
Source stream size                       : 15.4 MiB (95%)
Title                                    : mkv@GPAC2.3-DEV-rev35-gbbca86917-master
Language                                 : English
Encoded date                             : UTC 2023-01-20 11:34:32
Tagged date                              : UTC 2023-01-20 11:34:32
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 756 cd/m2
Maximum Frame-Average Light Level        : 115 cd/m2
mdhd_Duration                            : 9205
Codec configuration box                  : hvcC+dvvC
```
--- end body ---

None