From 9a57350c6b6ce2587589ee3193e698f7d5695d8b Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Tue, 28 May 2019 12:58:28 +0200 Subject: [PATCH] Use ';' to escape '/' characters in path to dumped received video stream Currently used ':' is bad because it prevents from specifying absolute path on windows (e.g. "C:\directory"). Now to specify path on windows, it can be passed unchanged in field trial: "WebRTC-DecoderDataDumpDirectory/C:\path\on\windows/" On linux ';' has to be used instead of '/': "WebRTC-DecoderDataDumpDirectory/;path;on;linux/" Bug: none Change-Id: Ia46c94bdfab95385618dde4fd3f2857e9ddf2d1c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138832 Commit-Queue: Ilya Nikolaevskiy Reviewed-by: Elad Alon Cr-Commit-Position: refs/heads/master@{#28085} --- video/video_receive_stream.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc index 2d99be690c..c495f4e5b9 100644 --- a/video/video_receive_stream.cc +++ b/video/video_receive_stream.cc @@ -348,9 +348,13 @@ void VideoReceiveStream::Start() { std::string decoded_output_file = field_trial::FindFullName("WebRTC-DecoderDataDumpDirectory"); - // Because '/' can't be used inside a field trial parameter, we use ':' + // Because '/' can't be used inside a field trial parameter, we use ';' // instead. - absl::c_replace(decoded_output_file, ':', '/'); + // This is only relevant to WebRTC-DecoderDataDumpDirectory + // field trial. ';' is chosen arbitrary. Even though it's a legal character + // in some file systems, we can sacrifice ability to use it in the path to + // dumped video, since it's developers-only feature for debugging. + absl::c_replace(decoded_output_file, ';', '/'); if (!decoded_output_file.empty()) { char filename_buffer[256]; rtc::SimpleStringBuilder ssb(filename_buffer);