mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-29 02:03:03 +08:00
libobs/media-io: Fix media-remux channel layout for 5 channels
FFmpeg has 5.0 as default layout for 5 channels. But obs-studio uses 4.1. This is a fix when remuxing. Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
@@ -158,10 +158,23 @@ static inline bool init_output(media_remux_job_t job, const char *out_filename)
|
||||
out_stream->codecpar->channel_layout =
|
||||
av_get_default_channel_layout(
|
||||
in_stream->codecpar->channels);
|
||||
/* The avutil default channel layout for 5 channels is
|
||||
* 5.0, which OBS does not support. Manually set 5
|
||||
* channels to 4.1. */
|
||||
if (in_stream->codecpar->channels == 5)
|
||||
out_stream->codecpar->channel_layout =
|
||||
av_get_channel_layout("4.1");
|
||||
#else
|
||||
av_channel_layout_default(
|
||||
&out_stream->codecpar->ch_layout,
|
||||
in_stream->codecpar->ch_layout.nb_channels);
|
||||
/* The avutil default channel layout for 5 channels is
|
||||
* 5.0, which OBS does not support. Manually set 5
|
||||
* channels to 4.1. */
|
||||
if (in_stream->codecpar->ch_layout.nb_channels == 5)
|
||||
out_stream->codecpar->ch_layout =
|
||||
(AVChannelLayout)
|
||||
AV_CHANNEL_LAYOUT_4POINT1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user