DLGPlayer
DLGPlayer copied to clipboard
No sound after playing the first video using WowzaStreamingEngine
Situation: Use VLC to stream playlist to WowzaStreamingEngine.
Detail: When the audio frame's position reach the end of the first video, the second video has started playing (the video frames of the second video has been read and rendering).
At this point, the position of audio frame(1st video) is later than the position of video frame(2nd video), then DLGPlayer will ignore the audio frame and continue playing until the position of the video frame reach the same position of the audio frame.
Code:
// DLGPlayer.m
- (void)readAudioFrame:(float *)data frames:(UInt32)frames channels:(UInt32)channels {
...
const double dt = _mediaPosition - frame.position;
if (dt < -0.1) { // audio is faster than video, silence
...
break;
}
...
}