/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "lib/ffmpeg_audio_stream.h"
#include "lib/frame_rate_change.h"
#include "lib/video_content.h"
+#include "lib/audio_content.h"
#include "test.h"
using boost::shared_ptr;
content->video->_video_frame_rate = 24;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 48000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000);
stream->_frame_rate = 44100;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 48000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000);
stream->_frame_rate = 80000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 96000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 96000);
content->video->_video_frame_rate = 23.976;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 47952);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952);
content->video->_video_frame_rate = 29.97;
film->set_video_frame_rate (30);
BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 47952);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952);
content->video->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 50000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000);
content->video->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 50000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000);
/* Check some out-there conversions (not the best) */
/* The FrameRateChange within resampled_audio_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
*/
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), lrint (48000 * 2 * 14.99 / 25));
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), lrint (48000 * 2 * 14.99 / 25));
}