projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use make_shared<>.
[dcpomatic.git]
/
test
/
play_test.cc
diff --git
a/test/play_test.cc
b/test/play_test.cc
index dcf8e7f6dd323e264ecc5d8d1197f4956355ea77..9b9e2c87bed21faf161d98682ec76c505c903915 100644
(file)
--- a/
test/play_test.cc
+++ b/
test/play_test.cc
@@
-1,19
+1,20
@@
/*
Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
/*
Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
- This program is free software; you can redistribute it and/or modify
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
This program
is distributed in the hope that it will be useful,
+
DCP-o-matic
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
*/
*/
@@
-23,6
+24,7
@@
#include "lib/dcp_content_type.h"
#include "lib/player_video_frame.h"
#include "test.h"
#include "lib/dcp_content_type.h"
#include "lib/player_video_frame.h"
#include "test.h"
+#include <iostream>
/* This test needs stuff in Player that is only included in debug mode */
#ifdef DCPOMATIC_DEBUG
/* This test needs stuff in Player that is only included in debug mode */
#ifdef DCPOMATIC_DEBUG
@@
-62,7
+64,7
@@
public:
if (_queue.empty ()) {
return optional<Video> ();
}
if (_queue.empty ()) {
return optional<Video> ();
}
-
+
Video v = _queue.back ();
_queue.pop_back ();
return v;
Video v = _queue.back ();
_queue.pop_back ();
return v;
@@
-86,18
+88,18
@@
BOOST_AUTO_TEST_CASE (play_test)
film->set_container (Ratio::from_id ("185"));
film->set_name ("play_test");
film->set_container (Ratio::from_id ("185"));
film->set_name ("play_test");
- shared_ptr<FFmpegContent> A
(new FFmpegContent (film, "test/data/red_24.mp4")
);
+ shared_ptr<FFmpegContent> A
= make_shared<FFmpegContent> (film, "test/data/red_24.mp4"
);
film->examine_and_add_content (A);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16);
film->examine_and_add_content (A);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16);
- shared_ptr<FFmpegContent> B
(new FFmpegContent (film, "test/data/red_30.mp4")
);
+ shared_ptr<FFmpegContent> B
= make_shared<FFmpegContent> (film, "test/data/red_30.mp4"
);
film->examine_and_add_content (B);
wait_for_jobs ();
BOOST_CHECK_EQUAL (B->video_length_after_3d_combine(), 16);
film->examine_and_add_content (B);
wait_for_jobs ();
BOOST_CHECK_EQUAL (B->video_length_after_3d_combine(), 16);
-
+
/* Film should have been set to 25fps */
BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);
/* Film should have been set to 25fps */
BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);
@@
-105,7
+107,7
@@
BOOST_AUTO_TEST_CASE (play_test)
/* A is 16 frames long at 25 fps */
BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25);
/* A is 16 frames long at 25 fps */
BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25);
- shared_ptr<Player> player
(new Player (film)
);
+ shared_ptr<Player> player
= make_shared<Player> (film
);
PlayerWrapper wrap (player);
/* Seek and audio don't get on at the moment */
player->disable_audio ();
PlayerWrapper wrap (player);
/* Seek and audio don't get on at the moment */
player->disable_audio ();