The problem of playing multi-audio with FFmpeg + SDL

requirements:
play two audio files at the same time (duration: one long and one short). Playback requirements:
as shown in the figure:

  1. Audio file 1 plays normally, and the total length of the file is greater than the set playback duration
  2. Audio file 2. The total length of the file is less than the set playback duration

problem:
the total duration of audio file 2 is less than the set playback time. When audio 2 playback ends, audio file 1 becomes muted.

Code:

the code part hasn"t been sorted out yet
The

code has not been sorted out for the time being. I wonder if there are any partners who have encountered the same problem. How do you play multiple audio at the same time and can perfectly solve the problems encountered above?

Mar.10,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e917ff-1363.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e917ff-1363.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?