diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-10 16:38:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-12 09:13:51 +0100 |
| commit | b1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f (patch) | |
| tree | 9968238c6c0511f044e6fcdb4abcc08b5eb28f27 /test/video_content_scale_test.cc | |
| parent | 4a0ae92e28d7d1f0dd648d1b620efc324fdef161 (diff) | |
Remove all use of stringstream in an attempt to fix
the suspected thread-unsafe crash bugs on OS X.
Diffstat (limited to 'test/video_content_scale_test.cc')
| -rw-r--r-- | test/video_content_scale_test.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index e297d0cd2..b1a1e258d 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -34,8 +34,7 @@ void test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop crop, Ratio const * ratio, bool scale, dcp::Size correct) { shared_ptr<Film> film; - locked_stringstream s; - s << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + string s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<Content>" "<Type>FFmpeg</Type>" "<Path>/home/c.hetherington/DCP/prophet_clip.mkv</Path>" @@ -44,26 +43,26 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop "<TrimStart>0</TrimStart>" "<TrimEnd>0</TrimEnd>" "<VideoLength>2879</VideoLength>" - "<VideoWidth>" << content_size.width << "</VideoWidth>" - "<VideoHeight>" << content_size.height << "</VideoHeight>" + "<VideoWidth>" + raw_convert<string>(content_size.width) + "</VideoWidth>" + "<VideoHeight>" + raw_convert<string>(content_size.height) + "</VideoHeight>" "<VideoFrameRate>23.97602462768555</VideoFrameRate>" "<OriginalVideoFrameRate>23.97602462768555</OriginalVideoFrameRate>" "<VideoFrameType>0</VideoFrameType>" "<SampleAspectRatio>1</SampleAspectRatio>" "<BitsPerPixel>12</BitsPerPixel>" - "<LeftCrop>" << crop.left << "</LeftCrop>" - "<RightCrop>" << crop.right << "</RightCrop>" - "<TopCrop>" << crop.top << "</TopCrop>" - "<BottomCrop>" << crop.bottom << "</BottomCrop>" + "<LeftCrop>" + raw_convert<string>(crop.left) + "</LeftCrop>" + "<RightCrop>" + raw_convert<string>(crop.right) + "</RightCrop>" + "<TopCrop>" + raw_convert<string>(crop.top) + "</TopCrop>" + "<BottomCrop>" + raw_convert<string>(crop.bottom) + "</BottomCrop>" "<Scale>"; if (ratio) { - s << "<Ratio>" << ratio->id() << "</Ratio>"; + s += "<Ratio>" + ratio->id() + "</Ratio>"; } else { - s << "<Scale>" << scale << "</Scale>"; + s += "<Scale>" + string(scale ? "1" : "0") + "</Scale>"; } - s << "</Scale>" + s += "</Scale>" "<ColourConversion>" "<InputGamma>2.4</InputGamma>" "<InputGammaLinearised>1</InputGammaLinearised>" @@ -87,7 +86,7 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop "</Content>"; shared_ptr<cxml::Document> doc (new cxml::Document ()); - doc->read_string(s.str ()); + doc->read_string (s); list<string> notes; shared_ptr<FFmpegContent> vc (new FFmpegContent (film, doc, 10, notes)); |
