projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use get_pixel_size rather than get_size which is slightly nicer as we then don't...
[dcpomatic.git]
/
src
/
lib
/
audio_content.cc
diff --git
a/src/lib/audio_content.cc
b/src/lib/audio_content.cc
index d2d90a1f5b42ce9c0d493ea402765995f1a9512d..6d9c85ca20201c2719931216b114428163abb9ad 100644
(file)
--- a/
src/lib/audio_content.cc
+++ b/
src/lib/audio_content.cc
@@
-18,16
+18,16
@@
*/
#include "audio_content.h"
*/
#include "audio_content.h"
-#include "analyse_audio_job.h"
-#include "job_manager.h"
#include "film.h"
#include "exceptions.h"
#include "config.h"
#include "frame_rate_change.h"
#include "raw_convert.h"
#include "film.h"
#include "exceptions.h"
#include "config.h"
#include "frame_rate_change.h"
#include "raw_convert.h"
-#include "
playlist.h
"
+#include "
compose.hpp
"
#include <libcxml/cxml.h>
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
+#include <iostream>
#include "i18n.h"
#include "i18n.h"
@@
-73,7
+73,7
@@
AudioContent::AudioContent (shared_ptr<const Film> film, boost::filesystem::path
AudioContent::AudioContent (shared_ptr<const Film> film, cxml::ConstNodePtr node)
: Content (film, node)
{
AudioContent::AudioContent (shared_ptr<const Film> film, cxml::ConstNodePtr node)
: Content (film, node)
{
- _audio_gain = node->number_child<
float
> ("AudioGain");
+ _audio_gain = node->number_child<
double
> ("AudioGain");
_audio_delay = node->number_child<int> ("AudioDelay");
}
_audio_delay = node->number_child<int> ("AudioDelay");
}
@@
-168,6
+168,7
@@
AudioContent::audio_mapping () const
}
AudioMapping merged (channels, MAX_DCP_AUDIO_CHANNELS);
}
AudioMapping merged (channels, MAX_DCP_AUDIO_CHANNELS);
+ merged.make_zero ();
int c = 0;
int s = 0;
int c = 0;
int s = 0;
@@
-175,7
+176,9
@@
AudioContent::audio_mapping () const
AudioMapping mapping = i->mapping ();
for (int j = 0; j < mapping.input_channels(); ++j) {
for (int k = 0; k < MAX_DCP_AUDIO_CHANNELS; ++k) {
AudioMapping mapping = i->mapping ();
for (int j = 0; j < mapping.input_channels(); ++j) {
for (int k = 0; k < MAX_DCP_AUDIO_CHANNELS; ++k) {
- merged.set (c, k, mapping.get (j, k));
+ if (k < mapping.output_channels()) {
+ merged.set (c, k, mapping.get (j, k));
+ }
}
++c;
}
}
++c;
}
@@
-191,13
+194,10
@@
AudioContent::audio_mapping () const
int
AudioContent::resampled_audio_frame_rate () const
{
int
AudioContent::resampled_audio_frame_rate () const
{
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
-
/* Resample to a DCI-approved sample rate */
double t = has_rate_above_48k() ? 96000 : 48000;
/* Resample to a DCI-approved sample rate */
double t = has_rate_above_48k() ? 96000 : 48000;
- FrameRateChange frc = film->active_frame_rate_change (position ());
+ FrameRateChange frc = film
()
->active_frame_rate_change (position ());
/* Compensate if the DCP is being run at a different frame rate
to the source; that is, if the video is run such that it will
/* Compensate if the DCP is being run at a different frame rate
to the source; that is, if the video is run such that it will
@@
-208,7
+208,7
@@
AudioContent::resampled_audio_frame_rate () const
t /= frc.speed_up;
}
t /= frc.speed_up;
}
- return rint (t);
+ return
l
rint (t);
}
string
}
string