Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: content/renderer/media/media_stream_video_source.cc

Issue 2559223002: Ensure that selected video format is valid when resolving video-capture constraints. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_source.cc
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc
index ab1453fed9bb3c12922edc98e15080c5bf316bad..c95f429b466454e534878c674a5cc31578e43c46 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -500,7 +500,12 @@ bool MediaStreamVideoSource::FindBestFormatWithConstraints(
// A request with constraints that can be fulfilled.
*fulfilled_constraints = track_constraints;
- *best_format = GetBestCaptureFormat(filtered_formats, track_constraints);
+ media::VideoCaptureFormat best_format_candidate =
+ GetBestCaptureFormat(filtered_formats, track_constraints);
+ if (!best_format_candidate.IsValid())
+ continue;
+
+ *best_format = best_format_candidate;
DVLOG(3) << "Found a track that matches the constraints";
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698