diff --git a/matroska.h b/matroska.h index aadf380af..5e51a92db 100644 --- a/matroska.h +++ b/matroska.h @@ -13,7 +13,7 @@ /*! \file - \version \$Id: matroska.h,v 1.7 2003/04/24 20:36:45 mosu Exp $ + \version \$Id: matroska.h,v 1.8 2003/04/29 16:23:12 mosu Exp $ \brief Definitions for the various Codec IDs \author Moritz Bunkus */ @@ -25,7 +25,7 @@ #define MKV_A_MP3 "A_MPEGLAYER3" #define MKV_A_AC3 "A_AC3" -#define MKV_A_PCM16 "A_PCMLIN16" +#define MKV_A_PCM "A_PCMLIN" #define MKV_A_VORBIS "A_VORBIS" #define MKV_A_ACM "A_MS/ACM" diff --git a/p_pcm.cpp b/p_pcm.cpp index b9ab59473..62525c70f 100644 --- a/p_pcm.cpp +++ b/p_pcm.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: p_pcm.cpp,v 1.15 2003/04/21 08:29:50 mosu Exp $ + \version \$Id: p_pcm.cpp,v 1.16 2003/04/29 16:23:12 mosu Exp $ \brief PCM output module \author Moritz Bunkus */ @@ -49,10 +49,6 @@ pcm_packetizer_c::pcm_packetizer_c(unsigned long nsamples_per_sec, bytes_output = 0; remaining_sync = 0; - if (bits_per_sample != 16) - throw error_c("Error: pcm_packetizer: Only files with 16bits per sample " - "are supported at the moment.\n"); - set_header(); } @@ -66,9 +62,10 @@ void pcm_packetizer_c::set_header() { set_serial(-1); set_track_type(track_audio); - set_codec_id(MKV_A_PCM16); + set_codec_id(MKV_A_PCM); set_audio_sampling_freq((float)samples_per_sec); set_audio_channels(channels); + set_audio_bit_depth(bits_per_sample); if (ti->default_track) set_as_default_track('a'); diff --git a/pr_generic.cpp b/pr_generic.cpp index 1182134a6..5dc5bf5b1 100644 --- a/pr_generic.cpp +++ b/pr_generic.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: pr_generic.cpp,v 1.26 2003/04/27 09:14:47 mosu Exp $ + \version \$Id: pr_generic.cpp,v 1.27 2003/04/29 16:23:12 mosu Exp $ \brief functions common for all readers/packetizers \author Moritz Bunkus */ @@ -49,6 +49,7 @@ generic_packetizer_c::generic_packetizer_c(track_info_t *nti) throw(error_c): haudio_sampling_freq = -1.0; haudio_channels = -1; + haudio_bit_depth = -1; hvideo_pixel_width = -1; hvideo_pixel_height = -1; @@ -137,6 +138,10 @@ void generic_packetizer_c::set_audio_channels(int channels) { haudio_channels = channels; } +void generic_packetizer_c::set_audio_bit_depth(int bit_depth) { + haudio_bit_depth = bit_depth; +} + void generic_packetizer_c::set_video_pixel_width(int width) { hvideo_pixel_width = width; } @@ -256,6 +261,10 @@ void generic_packetizer_c::set_header() { *(static_cast (&GetChild(audio))) = haudio_channels; + if (haudio_bit_depth != -1) + *(static_cast (&GetChild(audio))) = + haudio_bit_depth; + } } diff --git a/pr_generic.h b/pr_generic.h index e57b8d681..1226babb8 100644 --- a/pr_generic.h +++ b/pr_generic.h @@ -13,7 +13,7 @@ /*! \file - \version \$Id: pr_generic.h,v 1.27 2003/04/24 20:36:45 mosu Exp $ + \version \$Id: pr_generic.h,v 1.28 2003/04/29 16:23:12 mosu Exp $ \brief class definition for the generic reader and packetizer \author Moritz Bunkus */ @@ -74,7 +74,7 @@ protected: int hcodec_private_length; float haudio_sampling_freq; - int haudio_channels; + int haudio_channels, haudio_bit_depth; int hvideo_pixel_width, hvideo_pixel_height; float hvideo_frame_rate; @@ -108,6 +108,7 @@ public: virtual void set_audio_sampling_freq(float freq); virtual void set_audio_channels(int channels); + virtual void set_audio_bit_depth(int bit_depth); virtual void set_video_pixel_width(int width); virtual void set_video_pixel_height(int height); diff --git a/r_matroska.cpp b/r_matroska.cpp index d6acc5531..eac7a4d74 100644 --- a/r_matroska.cpp +++ b/r_matroska.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: r_matroska.cpp,v 1.13 2003/04/28 07:27:27 mosu Exp $ + \version \$Id: r_matroska.cpp,v 1.14 2003/04/29 16:23:12 mosu Exp $ \brief Matroska reader \author Moritz Bunkus */ @@ -326,7 +326,7 @@ void mkv_reader_c::verify_tracks() { t->a_formattag = 0x0055; else if (!strcmp(t->codec_id, MKV_A_AC3)) t->a_formattag = 0x2000; - else if (!strcmp(t->codec_id, MKV_A_PCM16)) + else if (!strcmp(t->codec_id, MKV_A_PCM)) t->a_formattag = 0x0001; else if (!strcmp(t->codec_id, MKV_A_VORBIS)) { if (t->private_data == NULL) {