提交 fc596f61 编写于 作者: J John Bradley

obs-ffmpeg: Fix spurious bad channel layout

Some formats (like WMV) would send out audio packets that
had channels set but did not specify a channel layout.
Solution is to no longer rely on channel layout to get the
channels and just get the channel count directly off the
FFmpeg audio frame.
上级 d42a7ce6
......@@ -289,8 +289,7 @@ static bool audio_frame(struct ff_frame *frame, void *opaque)
d_pts = ff_get_sync_clock(&s->demuxer->clock) - frame->pts;
pts = os_gettime_ns() - (uint64_t)(d_pts * 1000000000.0L);
int channels = av_get_channel_layout_nb_channels(
av_frame_get_channel_layout(frame->frame));
int channels = av_frame_get_channels(frame->frame);
for(int i = 0; i < channels; i++)
audio_data.data[i] = frame->frame->data[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册