Skip to content

Commit

Permalink
Movies: Do not decode the audiostream if an external movie audio is p…
Browse files Browse the repository at this point in the history
…laying

Fix regression introduced by b6bf503
  • Loading branch information
julianxhokaxhiu committed Sep 4, 2023
1 parent b802489 commit e0277ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- Full commit list since last stable release: https://github.com/julianxhokaxhiu/FFNx/compare/1.16.0...master

## Common

- Movie: Fix audio stream playing at the same time as the external audio

## FF7

- Ambient: Allow ambient effects to playback in fields that use movies as background
Expand Down
9 changes: 7 additions & 2 deletions src/video/movies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,13 @@ uint32_t ffmpeg_prepare_movie(char *name, bool with_audio)
goto exit;
}

audiostream = av_find_best_stream(format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &acodec, 0);
if(with_audio && audiostream < 0 && (trace_movies || trace_all)) ffnx_trace("prepare_movie: no audio stream found\n");
if (with_audio)
{
audiostream = av_find_best_stream(format_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &acodec, 0);
if(audiostream < 0 && (trace_movies || trace_all)) ffnx_trace("prepare_movie: no audio stream found\n");
}
else
audiostream = -1;

codec_ctx = avcodec_alloc_context3(codec);
if (!codec_ctx) {
Expand Down

0 comments on commit e0277ce

Please sign in to comment.