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 http://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: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

I tried streaming a multiple track stream using gstreamer and package to hls it with gpac to then serve the segments with an origin, I notice that the option `max_cache_segs` is causing the playlist to be deleted.

GStreamer command 

```bash
gst-launch-1.0 -v \  
  videotestsrc pattern=snow name="decodebin_video_0" \  
  videotestsrc pattern=ball name="decodebin_video_1" \  
  videotestsrc pattern=smpte100 name="decodebin_video_2" \  
  audiotestsrc freq=200 name="decodebin_audio_1" \  
  decodebin_video_0. ! video/x-raw ! queue name="src_0_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_0_video_raw_tee" \  
  decodebin_video_1. ! video/x-raw ! queue name="src_1_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_1_video_raw_tee" \  
  decodebin_video_2. ! video/x-raw ! queue name="src_3_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_3_video_raw_tee" \  
  decodebin_audio_1. ! audio/x-raw ! queue name="src_5_decodebin_audio_queue" ! tee name="src_5_audio_raw_tee" \  
  src_5_audio_raw_tee. ! queue name="src_5_audio_enc_queue" ! audioconvert ! audioresample ! audio/x-raw ! tee name="src_5_audio_resample_tee" \  
  src_5_audio_resample_tee. ! queue ! audioconvert ! "audio/x-raw,channels=2" ! avenc_aac name="src_5_audio_encoder" ! "audio/mpeg" ! aacparse ! tee name="src_5_audio_encoder_tee" \  
  src_0_video_raw_tee. ! queue name="src_0_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_0_video_transcoded_enc_tee" \  
  src_1_video_raw_tee. ! queue name="src_1_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_1_video_transcoded_enc_tee" \  
  src_3_video_raw_tee. ! queue name="src_3_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_3_video_transcoded_enc_tee" \  
  src_0_video_transcoded_enc_tee. ! queue name="src_0_video_transcoded_queue_mpegts" ! mpegtsmux m2ts-mode=false name="mpegts_mux_transcoded_0" ! tee name="mpegts_mux_transcoded_tee_0" \  
  src_1_video_transcoded_enc_tee. ! queue name="src_1_video_transcoded_queue_mpegts" ! mpegts_mux_transcoded_0. \ 
  src_3_video_transcoded_enc_tee. ! queue name="src_3_video_transcoded_queue_mpegts" ! mpegts_mux_transcoded_0. \ 
  src_5_audio_encoder_tee. ! queue ! mpegts_mux_transcoded_0. \ 
  mpegts_mux_transcoded_tee_0. ! queue ! udpsink host="255.255.255.255" port=5000 name="udp_broadcast_0"
```

GPAC command 

```bash
gpac \
-i udp://255.255.255.255:5000/:gpac:listen=true:tsprobe=true reframer:rt=on restamp \ 
-o /tmp/workdir/content/playlist.m3u8:gpac:dmode=dynamic:hmode=push:max_cache_segs=16
```

These commands creates a m3u8 playlist with the sub-playlist for each track in the input, but as mentioned before the playlist get deleted, making impossible to access to the stream, since the option `max_cache_segs` is for keeping a limit number of segments it shoudnt affect the number of playlist, also this happens only when the source has multiple tracks

In this GIF in shown that at the moment of running those commands all the playlist appear correctly, but get deleted almost instantly

![output_2](https://github.com/gpac/gpac/assets/60185854/b3c1d5ec-b349-480a-939c-9dbfde2a8a3e)



Issue with the option max_cache_segs deleting playlists
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Issue with the option max_cache_segs deleting playlists
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 http://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: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

I tried streaming a multiple track stream using gstreamer and package to hls it with gpac to then serve the segments with an origin, I notice that the option `max_cache_segs` is causing the playlist to be deleted.

GStreamer command 

```bash
gst-launch-1.0 -v \  
  videotestsrc pattern=snow name="decodebin_video_0" \  
  videotestsrc pattern=ball name="decodebin_video_1" \  
  videotestsrc pattern=smpte100 name="decodebin_video_2" \  
  audiotestsrc freq=200 name="decodebin_audio_1" \  
  decodebin_video_0. ! video/x-raw ! queue name="src_0_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_0_video_raw_tee" \  
  decodebin_video_1. ! video/x-raw ! queue name="src_1_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_1_video_raw_tee" \  
  decodebin_video_2. ! video/x-raw ! queue name="src_3_decodebin_video_queue" ! clockoverlay 'time-format="%T %Z"' ! tee name="src_3_video_raw_tee" \  
  decodebin_audio_1. ! audio/x-raw ! queue name="src_5_decodebin_audio_queue" ! tee name="src_5_audio_raw_tee" \  
  src_5_audio_raw_tee. ! queue name="src_5_audio_enc_queue" ! audioconvert ! audioresample ! audio/x-raw ! tee name="src_5_audio_resample_tee" \  
  src_5_audio_resample_tee. ! queue ! audioconvert ! "audio/x-raw,channels=2" ! avenc_aac name="src_5_audio_encoder" ! "audio/mpeg" ! aacparse ! tee name="src_5_audio_encoder_tee" \  
  src_0_video_raw_tee. ! queue name="src_0_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_0_video_transcoded_enc_tee" \  
  src_1_video_raw_tee. ! queue name="src_1_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_1_video_transcoded_enc_tee" \  
  src_3_video_raw_tee. ! queue name="src_3_video_scale_queue" ! videoscale ! "video/x-raw" ! x264enc ! "video/x-h264" ! h264parse ! tee name="src_3_video_transcoded_enc_tee" \  
  src_0_video_transcoded_enc_tee. ! queue name="src_0_video_transcoded_queue_mpegts" ! mpegtsmux m2ts-mode=false name="mpegts_mux_transcoded_0" ! tee name="mpegts_mux_transcoded_tee_0" \  
  src_1_video_transcoded_enc_tee. ! queue name="src_1_video_transcoded_queue_mpegts" ! mpegts_mux_transcoded_0. \ 
  src_3_video_transcoded_enc_tee. ! queue name="src_3_video_transcoded_queue_mpegts" ! mpegts_mux_transcoded_0. \ 
  src_5_audio_encoder_tee. ! queue ! mpegts_mux_transcoded_0. \ 
  mpegts_mux_transcoded_tee_0. ! queue ! udpsink host="255.255.255.255" port=5000 name="udp_broadcast_0"
```

GPAC command 

```bash
gpac \
-i udp://255.255.255.255:5000/:gpac:listen=true:tsprobe=true reframer:rt=on restamp \ 
-o /tmp/workdir/content/playlist.m3u8:gpac:dmode=dynamic:hmode=push:max_cache_segs=16
```

These commands creates a m3u8 playlist with the sub-playlist for each track in the input, but as mentioned before the playlist get deleted, making impossible to access to the stream, since the option `max_cache_segs` is for keeping a limit number of segments it shoudnt affect the number of playlist, also this happens only when the source has multiple tracks

In this GIF in shown that at the moment of running those commands all the playlist appear correctly, but get deleted almost instantly

![output_2](https://github.com/gpac/gpac/assets/60185854/b3c1d5ec-b349-480a-939c-9dbfde2a8a3e)



--- end body ---
