mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
Support for setting the output sampling frequency.
This commit is contained in:
parent
cb94453aa5
commit
a3fd7dff56
@ -127,6 +127,7 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *nreader,
|
||||
hcodec_private_length = 0;
|
||||
|
||||
haudio_sampling_freq = -1.0;
|
||||
haudio_output_sampling_freq = -1.0;
|
||||
haudio_channels = -1;
|
||||
haudio_bit_depth = -1;
|
||||
|
||||
@ -275,6 +276,10 @@ void generic_packetizer_c::set_audio_sampling_freq(float freq) {
|
||||
haudio_sampling_freq = freq;
|
||||
}
|
||||
|
||||
void generic_packetizer_c::set_audio_output_sampling_freq(float freq) {
|
||||
haudio_output_sampling_freq = freq;
|
||||
}
|
||||
|
||||
void generic_packetizer_c::set_audio_channels(int channels) {
|
||||
haudio_channels = channels;
|
||||
}
|
||||
@ -462,15 +467,20 @@ void generic_packetizer_c::set_headers() {
|
||||
GetChild<KaxTrackAudio>(*track_entry);
|
||||
|
||||
if (haudio_sampling_freq != -1.0)
|
||||
*(static_cast<EbmlFloat *> (&GetChild<KaxAudioSamplingFreq>(audio))) =
|
||||
*(static_cast<EbmlFloat *>(&GetChild<KaxAudioSamplingFreq>(audio))) =
|
||||
haudio_sampling_freq;
|
||||
|
||||
if (haudio_output_sampling_freq != -1.0)
|
||||
*(static_cast<EbmlFloat *>
|
||||
(&GetChild<KaxAudioOutputSamplingFreq>(audio))) =
|
||||
haudio_output_sampling_freq;
|
||||
|
||||
if (haudio_channels != -1)
|
||||
*(static_cast<EbmlUInteger *> (&GetChild<KaxAudioChannels>(audio))) =
|
||||
*(static_cast<EbmlUInteger *>(&GetChild<KaxAudioChannels>(audio))) =
|
||||
haudio_channels;
|
||||
|
||||
if (haudio_bit_depth != -1)
|
||||
*(static_cast<EbmlUInteger *> (&GetChild<KaxAudioBitDepth>(audio))) =
|
||||
*(static_cast<EbmlUInteger *>(&GetChild<KaxAudioBitDepth>(audio))) =
|
||||
haudio_bit_depth;
|
||||
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ protected:
|
||||
unsigned char *hcodec_private;
|
||||
int hcodec_private_length;
|
||||
|
||||
float haudio_sampling_freq;
|
||||
float haudio_sampling_freq, haudio_output_sampling_freq;
|
||||
int haudio_channels, haudio_bit_depth;
|
||||
|
||||
int hvideo_pixel_width, hvideo_pixel_height;
|
||||
@ -193,6 +193,7 @@ public:
|
||||
virtual int64_t get_track_default_duration_ns();
|
||||
|
||||
virtual void set_audio_sampling_freq(float freq);
|
||||
virtual void set_audio_output_sampling_freq(float freq);
|
||||
virtual void set_audio_channels(int channels);
|
||||
virtual void set_audio_bit_depth(int bit_depth);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user