Add audio support and mute option for video playback - #4
Open
sortedcord wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds audio playback support for video splash screens in
gsplash, allowing video files with audio streams to play sound unless the new--muteflag is provided. It introduces a newAudioPlayerimplementation using FFmpeg and SDL2, updates the build system and main program logic to manage audio, and exposes audio-related command-line options.Audio playback support for video splash screens:
src/audio.cimplementation andsrc/audio.hinterface, providing theAudioPlayerstruct and functions for initializing, decoding, and cleaning up audio streams using FFmpeg and SDL2 audio subsystems.Makefileto link againstlibswresampleand includesrc/audio.cin the build.Integration with main program:
src/gsplash.cto initialize SDL audio, detect video audio streams, and manage anAudioPlayerinstance alongside video playback. Audio playback is started automatically unless the new--muteflag is set.--mutecommand-line argument to suppress audio playback and updated the help message accordingly.Video/audio stream detection:
VideoPlayerinsrc/video.handsrc/video.cto track both video and audio stream indices, allowing the main program to determine when audio playback is possible.Other improvements:
These changes collectively enable synchronized audio/video splash screens in
gsplash, with robust handling and user control over audio playback.