From a3fd7dff56efd71e84ee867090ff1f21142b5ad8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 9 Sep 2003 19:33:40 +0000 Subject: [PATCH] Support for setting the output sampling frequency. --- src/pr_generic.cpp | 16 +++++++++++++--- src/pr_generic.h | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pr_generic.cpp b/src/pr_generic.cpp index e27e9f244..c001ebc3b 100644 --- a/src/pr_generic.cpp +++ b/src/pr_generic.cpp @@ -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(*track_entry); if (haudio_sampling_freq != -1.0) - *(static_cast (&GetChild(audio))) = + *(static_cast(&GetChild(audio))) = haudio_sampling_freq; + if (haudio_output_sampling_freq != -1.0) + *(static_cast + (&GetChild(audio))) = + haudio_output_sampling_freq; + if (haudio_channels != -1) - *(static_cast (&GetChild(audio))) = + *(static_cast(&GetChild(audio))) = haudio_channels; if (haudio_bit_depth != -1) - *(static_cast (&GetChild(audio))) = + *(static_cast(&GetChild(audio))) = haudio_bit_depth; } diff --git a/src/pr_generic.h b/src/pr_generic.h index 94f4598e6..662e62ba1 100644 --- a/src/pr_generic.h +++ b/src/pr_generic.h @@ -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);