FFmpeg sometimes generates swf files without a SoundStreamBlock tag in each frame. This causes Ruffle to constantly interrupt the audio stream.
Commenting out the lines below fixes the issue but I'm not sure what side effects it'll have elsewhere. It looks like it's safe to remove though.
|
// If we are playing a streaming sound, there should(?) be a `SoundStreamBlock` on each frame. |
|
if !has_stream_block { |
|
self.0.write(context.gc_context).stop_audio_stream(context); |
|
} |
Also, I wonder if stopping the stream like this doesn't cut off the audio too early sometimes just before the stream ends (previous frame data is still playing but the next frame doesn't have a SoundStreamBlock tag).
test swf:
sound_stream_block.zip
looks like this mostly happens with high fps videos (60fps here).
FFmpeg sometimes generates swf files without a SoundStreamBlock tag in each frame. This causes Ruffle to constantly interrupt the audio stream.
Commenting out the lines below fixes the issue but I'm not sure what side effects it'll have elsewhere. It looks like it's safe to remove though.
ruffle/core/src/display_object/movie_clip.rs
Lines 1087 to 1090 in f96a414
Also, I wonder if stopping the stream like this doesn't cut off the audio too early sometimes just before the stream ends (previous frame data is still playing but the next frame doesn't have a SoundStreamBlock tag).
test swf:
sound_stream_block.zip
looks like this mostly happens with high fps videos (60fps here).