Skip to content

Commit 3475c50

Browse files
MaxHeimbrockclaude
andcommitted
Gate the internal H264 fallback in Create() on the probe result
GetSupportedFormats() no longer advertises the internal H264 formats when the probe fails, but Create() still handed back the broken FFmpeg decoder when the platform factories reject a format (e.g. a profile-level-id VideoToolbox does not match). Gate the fallback on the same probe so that path returns nullptr with a clear "No VideoDecoder found" error instead of a decoder that fails Configure() at runtime. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f0506f8 commit 3475c50

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

webrtc-sys/src/video_decoder_factory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ std::unique_ptr<webrtc::VideoDecoder> VideoDecoderFactory::Create(
157157
return webrtc::CreateVp8Decoder(env);
158158
if (absl::EqualsIgnoreCase(format.name, webrtc::kVp9CodecName))
159159
return webrtc::VP9Decoder::Create();
160-
if (absl::EqualsIgnoreCase(format.name, webrtc::kH264CodecName))
160+
if (absl::EqualsIgnoreCase(format.name, webrtc::kH264CodecName) &&
161+
internal_h264_decoder_works_)
161162
return webrtc::H264Decoder::Create();
162163

163164

0 commit comments

Comments
 (0)