Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at https://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: https://gpac.io/bug-reporting/

In memory-writing mode,
we use `gf_isom_open` using `"_gpac_isobmff_redirect"`    
`gf_isom_set_write_callback`   
after setting callback function   
When exactly is the callback function called?  
I think that `gf_isom_finalize` and `gf_isom_close_segment` call the callback function  

And   

If I want to call the callback function forcely, how to do that?  

My plan is that   
After making All segments, I calculate all duration of segments and allocate duration using   
`gf_isom_set_movie_duration`      
then I want to receive moov box data with a duration value assigned to it through callback function.   

Can I use `on_last_block_start` to handle the above situation?    
styp box is made twice
This is a GitHub Issue
repo:gpac
owner:gpac
Title : styp box is made twice
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at https://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: https://gpac.io/bug-reporting/

In memory-writing mode,
we use `gf_isom_open` using `"_gpac_isobmff_redirect"`    
`gf_isom_set_write_callback`   
after setting callback function   
When exactly is the callback function called?  
I think that `gf_isom_finalize` and `gf_isom_close_segment` call the callback function  

And   

If I want to call the callback function forcely, how to do that?  

My plan is that   
After making All segments, I calculate all duration of segments and allocate duration using   
`gf_isom_set_movie_duration`      
then I want to receive moov box data with a duration value assigned to it through callback function.   

Can I use `on_last_block_start` to handle the above situation?    
--- end body ---
