Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed whitespaces at the end of the line.

  • Loading branch information...
commit c1f3e862f5cae582e86636b58c816211a9efca65 1 parent cc4da9a
@mbunkus authored
Showing with 479 additions and 479 deletions.
  1. +8 −8 ac3_common.cpp
  2. +3 −3 cluster_helper.cpp
  3. +13 −13 common.h
  4. +55 −55 dts_common.cpp
  5. +30 −30 dts_common.h
  6. +5 −5 install-sh
  7. +2 −2 iso639.cpp
  8. +12 −12 mkvinfo.cpp
  9. +21 −21 mkvmerge.cpp
  10. +3 −3 mp3_common.cpp
  11. +6 −6 ogmstreams.h
  12. +13 −13 p_aac.cpp
  13. +3 −3 p_aac.h
  14. +13 −13 p_ac3.cpp
  15. +3 −3 p_ac3.h
  16. +27 −27 p_dts.cpp
  17. +7 −7 p_dts.h
  18. +13 −13 p_mp3.cpp
  19. +2 −2 p_mp3.h
  20. +3 −3 p_pcm.cpp
  21. +4 −4 p_pcm.h
  22. +2 −2 p_textsubs.h
  23. +2 −2 p_video.cpp
  24. +3 −3 p_video.h
  25. +5 −5 p_vorbis.cpp
  26. +2 −2 p_vorbis.h
  27. +2 −2 pr_generic.cpp
  28. +2 −2 pr_generic.h
  29. +7 −7 r_aac.cpp
  30. +2 −2 r_aac.h
  31. +8 −8 r_ac3.cpp
  32. +2 −2 r_ac3.h
  33. +18 −18 r_avi.cpp
  34. +3 −3 r_avi.h
  35. +12 −12 r_dts.cpp
  36. +2 −2 r_dts.h
  37. +32 −32 r_matroska.cpp
  38. +5 −5 r_matroska.h
  39. +5 −5 r_microdvd.cpp
  40. +4 −4 r_microdvd.h
  41. +7 −7 r_mp3.cpp
  42. +2 −2 r_mp3.h
  43. +33 −33 r_ogm.cpp
  44. +4 −4 r_ogm.h
  45. +6 −6 r_srt.cpp
  46. +3 −3 r_srt.h
  47. +10 −10 r_vobsub.cpp
  48. +2 −2 r_vobsub.h
  49. +29 −29 r_wav.cpp
  50. +3 −3 r_wav.h
  51. +14 −14 subtitles.cpp
  52. +2 −2 subtitles.h
View
16 ac3_common.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: ac3_common.cpp,v 1.4 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: ac3_common.cpp,v 1.5 2003/05/20 06:30:24 mosu Exp $
\brief helper function for AC3 data
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -25,7 +25,7 @@
int find_ac3_header(unsigned char *buf, int size, ac3_header_t *ac3_header) {
static int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160,
192, 224, 256, 320, 384, 448, 512, 576, 640};
- static unsigned char lfeon[8] = {0x10, 0x10, 0x04, 0x04, 0x04, 0x01,
+ static unsigned char lfeon[8] = {0x10, 0x10, 0x04, 0x04, 0x04, 0x01,
0x04, 0x01};
static unsigned char halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
ac3_header_t header;
@@ -66,18 +66,18 @@ int find_ac3_header(unsigned char *buf, int size, ac3_header_t *ac3_header) {
return -1;
}
switch(header.flags & A52_CHANNEL_MASK) {
- case A52_MONO:
+ case A52_MONO:
header.channels=1;
break;
- case A52_CHANNEL:
+ case A52_CHANNEL:
case A52_STEREO:
case A52_CHANNEL1:
case A52_CHANNEL2:
- case A52_DOLBY:
+ case A52_DOLBY:
header.channels=2;
break;
case A52_2F1R:
- case A52_3F:
+ case A52_3F:
header.channels=3;
break;
case A52_3F1R:
@@ -91,9 +91,9 @@ int find_ac3_header(unsigned char *buf, int size, ac3_header_t *ac3_header) {
if (header.flags & A52_LFE)
header.channels++;
memcpy(ac3_header, &header, sizeof(ac3_header_t));
-
+
return i;
}
-
+
return -1;
}
View
6 cluster_helper.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: cluster_helper.cpp,v 1.17 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: cluster_helper.cpp,v 1.18 2003/05/20 06:30:24 mosu Exp $
\brief cluster helper
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -203,13 +203,13 @@ int cluster_helper_c::render(IOCallback *out) {
else if (write_cues) {
// Update the cues (index table) either if cue entries for
// I frames were requested and this is an I frame...
- if ((((generic_packetizer_c *)pack->source)->get_cue_creation() ==
+ if ((((generic_packetizer_c *)pack->source)->get_cue_creation() ==
CUES_IFRAMES) && (pack->bref == -1)) {
kax_cues->AddBlockGroup(*new_group);
cue_writing_requested = 1;
}
// ... or if the user requested entries for all frames.
- else if (((generic_packetizer_c *)pack->source)->get_cue_creation() ==
+ else if (((generic_packetizer_c *)pack->source)->get_cue_creation() ==
CUES_ALL) {
kax_cues->AddBlockGroup(*new_group);
cue_writing_requested = 1;
View
26 common.h
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: common.h,v 1.26 2003/05/19 18:24:52 mosu Exp $
+ \version \$Id: common.h,v 1.27 2003/05/20 06:30:24 mosu Exp $
\brief definitions used in all programs, helper functions
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -55,7 +55,7 @@
#define TYPEUNKNOWN 0
#define TYPEOGM 1
#define TYPEAVI 2
-#define TYPEWAV 3
+#define TYPEWAV 3
#define TYPESRT 4
#define TYPEMP3 5
#define TYPEAC3 6
@@ -113,47 +113,47 @@ class bit_cursor_c {
const unsigned char *byte_position;
const unsigned char *start_of_data;
unsigned int bits_valid;
-
+
bool out_of_data;
-public:
+public:
bit_cursor_c(const unsigned char *data, unsigned int len):
end_of_data(data+len), byte_position(data), start_of_data(data),
bits_valid(8), out_of_data(false) {
if (byte_position >= end_of_data)
out_of_data = true;
}
-
+
bool get_bits(unsigned int n, unsigned long &r) {
// returns true if less bits are available than asked for
r = 0;
-
+
while (n > 0) {
if (byte_position >= end_of_data) {
out_of_data = true;
return true;
}
-
+
unsigned int b = 8; // number of bits to extract from the current byte
if (b > n)
b = n;
if (b > bits_valid)
b = bits_valid;
-
+
unsigned int rshift = bits_valid-b;
-
+
r <<= b;
r |= ((*byte_position) >> rshift) & (0xff >> (8-b));
-
+
bits_valid -= b;
if (bits_valid == 0) {
bits_valid = 8;
byte_position += 1;
}
-
+
n -= b;
}
-
+
return false;
}
@@ -190,7 +190,7 @@ class bit_cursor_c {
int get_bit_position() {
return byte_position - start_of_data + 8 - bits_valid;
- }
+ }
};
#endif // __COMMON_H
View
110 dts_common.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: dts_common.cpp,v 1.5 2003/05/19 18:24:52 mosu Exp $
+ \version \$Id: dts_common.cpp,v 1.6 2003/05/20 06:30:24 mosu Exp $
\brief helper function for DTS data
\author Peter Niemayer <niemayer@isg.de>
\author Moritz Bunkus <moritz@bunkus.org>
@@ -40,11 +40,11 @@ static const channel_arrangement channel_arrangements[16] = {
{ 2, "LT, RT (left and right total)" },
{ 3, "C, L, R (center, left, right)" },
{ 3, "L, R, S (left, right, surround)" },
- { 4, "C, L, R, S (center, left, right, surround)" },
- { 4, "L, R, SL, SR (left, right, surround-left, surround-right)"},
+ { 4, "C, L, R, S (center, left, right, surround)" },
+ { 4, "L, R, SL, SR (left, right, surround-left, surround-right)"},
{ 5, "C, L, R, SL, SR (center, left, right, surround-left, surround-right)"},
{ 6, "CL, CR, L, R, SL, SR (center-left, center-right, left, right, "
- "surround-left, surround-right)"},
+ "surround-left, surround-right)"},
{ 6, "C, L, R, LR, RR, OV (center, left, right, left-rear, right-rear, "
"overhead)"},
{ 6, "CF, CR, LF, RF, LR, RR (center-front, center-rear, left-front, "
@@ -75,12 +75,12 @@ static const int transmission_bitrates[32] = {
3840000, -1 /*open*/, -2 /*variable*/, -3 /*lossless*/
// [15] 768000 is actually 754500 for DVD
// [24] 1536000 is actually 1509750 for DVD
- // [22] 1411200 is actually 1234800 for 14-bit DTS-CD audio
+ // [22] 1411200 is actually 1234800 for 14-bit DTS-CD audio
};
enum source_pcm_resolution {
spr_16 = 0,
- spr_16_ES, //_ES means: surround channels mastered in DTS-ES
+ spr_16_ES, //_ES means: surround channels mastered in DTS-ES
spr_20,
spr_20_ES,
spr_invalid4,
@@ -91,13 +91,13 @@ enum source_pcm_resolution {
int find_dts_header(const unsigned char *buf, unsigned int size,
struct dts_header_s *dts_header) {
-
+
unsigned int size_to_search = size-15;
if (size_to_search > size) {
// not enough data for one header
return -1;
}
-
+
unsigned int offset;
for (offset = 0; offset < size_to_search; offset++) {
// sync words appear aligned in the bit stream
@@ -112,35 +112,35 @@ int find_dts_header(const unsigned char *buf, unsigned int size,
// no header found
return -1;
}
-
+
bit_cursor_c bc(buf+offset+4, size-offset-4);
-
+
unsigned int t;
-
+
bc.get_bits(1, t);
dts_header->frametype = (t)? dts_header_s::frametype_normal :
dts_header_s::frametype_termination;
-
+
bc.get_bits(5, t);
dts_header->deficit_sample_count = (t+1) % 32;
-
+
bc.get_bits(1, t);
dts_header->crc_present = (t)? true : false;
-
+
bc.get_bits(7, t);
if (t < 5) {
fprintf(stderr,"DTS_Header problem: invalid number of blocks in frame\n");
//return -1;
}
dts_header->num_pcm_sample_blocks = t + 1;
-
+
bc.get_bits(14, t);
if (t < 95) {
fprintf(stderr,"DTS_Header problem: invalid frame bytes size\n");
return -1;
}
dts_header->frame_byte_size = t+1;
-
+
bc.get_bits(6, t);
if (t >= 16) {
dts_header->audio_channels = -1;
@@ -157,38 +157,38 @@ int find_dts_header(const unsigned char *buf, unsigned int size,
fprintf(stderr,"DTS_Header problem: invalid core sampling frequency\n");
return -1;
}
-
+
bc.get_bits(5, t);
dts_header->transmission_bitrate = transmission_bitrates[t];
-
+
bc.get_bit(dts_header->embedded_down_mix);
bc.get_bit(dts_header->embedded_dynamic_range);
bc.get_bit(dts_header->embedded_time_stamp);
bc.get_bit(dts_header->auxiliary_data);
bc.get_bit(dts_header->hdcd_master);
-
+
bc.get_bits(3, t);
- dts_header->extension_audio_descriptor =
+ dts_header->extension_audio_descriptor =
(dts_header_s::extension_audio_descriptor_enum)t;
-
+
bc.get_bit(dts_header->extended_coding);
-
+
bc.get_bit(dts_header->audio_sync_word_in_sub_sub);
-
+
bc.get_bits(2, t);
dts_header->lfe_type = (dts_header_s::lfe_type_enum)t;
-
+
bc.get_bit(dts_header->predictor_history_flag);
-
+
if (dts_header->crc_present) {
bc.get_bits(16, t);
// unsigned short header_CRC_sum = t; // not used yet
}
-
+
bc.get_bits(1, t);
dts_header->multirate_interpolator =
(dts_header_s::multirate_interpolator_enum)t;
-
+
bc.get_bits(4, t);
dts_header->encoder_software_revision = t;
if (t > 7) {
@@ -196,10 +196,10 @@ int find_dts_header(const unsigned char *buf, unsigned int size,
"encoder version\n");
return -1;
}
-
+
bc.get_bits(2, t);
dts_header->copy_history = t;
-
+
bc.get_bits(3, t);
switch (t) {
case spr_16:
@@ -231,16 +231,16 @@ int find_dts_header(const unsigned char *buf, unsigned int size,
dts_header->source_pcm_resolution = 24;
dts_header->source_surround_in_es = true;
break;
-
+
default:
fprintf(stderr,"DTS_Header problem: invalid source PCM resolution\n");
return -1;
}
-
+
bc.get_bit(dts_header->front_sum_difference);
bc.get_bit(dts_header->surround_sum_difference);
-
+
bool out_of_data = bc.get_bits(4, t);
if (dts_header->encoder_software_revision == 7) {
dts_header->dialog_normalization_gain = -((int)t);
@@ -249,20 +249,20 @@ int find_dts_header(const unsigned char *buf, unsigned int size,
} else {
dts_header->dialog_normalization_gain = 0;
}
-
+
if (out_of_data) {
fprintf(stderr,"DTS_Header problem: not enough data to read header\n");
return -1;
}
-
+
return offset;
-
+
}
// ============================================================================
void print_dts_header(const struct dts_header_s *h) {
-
+
fprintf(stderr,"DTS Frame Header Information:\n");
fprintf(stderr,"Frame Type : ");
@@ -273,7 +273,7 @@ void print_dts_header(const struct dts_header_s *h) {
h->deficit_sample_count);
}
fprintf(stderr,"\n");
-
+
fprintf(stderr,"CRC available : %s\n", (h->crc_present)? "yes" :
"no");
@@ -282,13 +282,13 @@ void print_dts_header(const struct dts_header_s *h) {
h->num_pcm_sample_blocks, h->num_pcm_sample_blocks * 32,
(h->num_pcm_sample_blocks * 32000.0) / h->core_sampling_frequency,
h->frame_byte_size);
-
+
fprintf(stderr,"Audio Channels : %d%s, arrangement: %s\n",
h->audio_channels, (h->source_surround_in_es)? " ES" : "" ,
h->audio_channel_arrangement);
-
+
fprintf(stderr,"Core sampling frequency: %u\n", h->core_sampling_frequency);
-
+
fprintf(stderr,"Transmission_bitrate : ");
if (h->transmission_bitrate == -1) {
fprintf(stderr,"open");
@@ -301,7 +301,7 @@ void print_dts_header(const struct dts_header_s *h) {
}
fprintf(stderr,"\n");
-
+
fprintf(stderr,"Embedded Down Mix : %s\n",
(h->embedded_down_mix)? "yes" : "no");
fprintf(stderr,"Embedded Dynamic Range : %s\n",
@@ -312,55 +312,55 @@ void print_dts_header(const struct dts_header_s *h) {
(h->auxiliary_data)? "yes" : "no");
fprintf(stderr,"HDCD Master : %s\n",
(h->hdcd_master)? "yes" : "no");
-
+
fprintf(stderr,"Extended Coding : ");
if (h->extended_coding) {
switch (h->extension_audio_descriptor) {
case dts_header_s::extension_xch:
fprintf(stderr,"Extra Channels");
- break;
+ break;
case dts_header_s::extension_x96k:
fprintf(stderr,"Extended frequency (x96k)");
- break;
+ break;
case dts_header_s::extension_xch_x96k:
fprintf(stderr,"Extra Channels and Extended frequency (x96k)");
- break;
+ break;
default:
fprintf(stderr,"yes, but unknown");
- break;
+ break;
}
} else {
fprintf(stderr,"no");
}
fprintf(stderr,"\n");
-
+
fprintf(stderr,"Audio Sync in sub-subs : %s\n",
(h->audio_sync_word_in_sub_sub)? "yes" : "no");
-
+
fprintf(stderr,"Low Frequency Effects : ");
switch (h->lfe_type) {
case dts_header_s::lfe_none:
fprintf(stderr,"none");
- break;
+ break;
case dts_header_s::lfe_128:
fprintf(stderr,"yes, interpolation factor 128");
- break;
+ break;
case dts_header_s::lfe_64:
fprintf(stderr,"yes, interpolation factor 64");
- break;
+ break;
case dts_header_s::lfe_invalid:
fprintf(stderr,"Invalid");
- break;
+ break;
}
fprintf(stderr,"\n");
-
+
fprintf(stderr,"Predictor History used : %s\n",
(h->predictor_history_flag)? "yes" : "no");
fprintf(stderr,"Multirate Interpolator : %s\n",
(h->multirate_interpolator == dts_header_s::mi_non_perfect)?
"non perfect" : "perfect");
-
+
fprintf(stderr,"Encoder Software Vers. : %u\n",
h->encoder_software_revision);
fprintf(stderr,"Copy History Bits : %u\n", h->copy_history);
@@ -370,7 +370,7 @@ void print_dts_header(const struct dts_header_s *h) {
(h->front_sum_difference)? "yes" : "no");
fprintf(stderr,"Surr. Encoded as Diff. : %s\n",
(h->surround_sum_difference)? "yes" : "no");
-
+
fprintf(stderr,"Dialog Normaliz. Gain : %d\n",
h->dialog_normalization_gain);
}
View
60 dts_common.h
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: dts_common.h,v 1.5 2003/05/20 06:27:08 mosu Exp $
+ \version \$Id: dts_common.h,v 1.6 2003/05/20 06:30:24 mosu Exp $
\brief definitions and helper functions for DTS data
\author Peter Niemayer <niemayer@isg.de>
\author Moritz Bunkus <moritz@bunkus.org>
@@ -30,62 +30,62 @@ static const long long max_dts_packet_size = 15384;
*/
typedef struct dts_header_s {
-
+
// ---------------------------------------------------
// ---------------------------------------------------
-
+
enum {
// Used to extremely precisely specify the end-of-stream (single PCM
// sample resolution).
- frametype_termination = 0,
+ frametype_termination = 0,
frametype_normal
} frametype;
-
+
// 0 for normal frames, 1 to 30 for termination frames. Number of PCM
// samples the frame is shorter than normal.
unsigned int deficit_sample_count;
-
+
// If true, a CRC-sum is included in the data.
- bool crc_present;
+ bool crc_present;
// number of PCM core sample blocks in this frame. Each PCM core sample block
// consists of 32 samples. Notice that "core samples" means "samples
// after the input decimator", so at sampling frequencies >48kHz, one core
// sample represents 2 (or 4 for frequencies >96kHz) output samples.
unsigned int num_pcm_sample_blocks;
-
+
// Number of bytes this frame occupies (range: 95 to 16 383).
unsigned int frame_byte_size;
-
+
// Number of audio channels, -1 for "unknown".
int audio_channels;
// String describing the audio channel arrangement
const char *audio_channel_arrangement;
-
+
// -1 for "invalid"
unsigned int core_sampling_frequency;
-
+
// in bit per second, or -1 == "open", -2 == "variable", -3 == "lossless"
int transmission_bitrate;
-
- // if true, sub-frames contain coefficients for downmixing to stereo
+
+ // if true, sub-frames contain coefficients for downmixing to stereo
bool embedded_down_mix;
-
+
// if true, sub-frames contain coefficients for dynamic range correction
bool embedded_dynamic_range;
-
+
// if true, a time stamp is embedded at the end of the core audio data
bool embedded_time_stamp;
-
+
// if true, auxiliary data is appended at the end of the core audio data
bool auxiliary_data;
-
+
// if true, the source material was mastered in HDCD format
bool hdcd_master;
-
+
enum extension_audio_descriptor_enum {
extension_xch = 0, // channel extension
extension_unknown1,
@@ -99,41 +99,41 @@ typedef struct dts_header_s {
// if true, extended coding data is placed after the core audio data
bool extended_coding;
-
+
// if true, audio data check words are placed in each sub-sub-frame
// rather than in each sub-frame, only
bool audio_sync_word_in_sub_sub;
-
+
enum lfe_type_enum {
lfe_none,
lfe_128, // 128 indicates the interpolation factor to reconstruct the
- // LFE channel
+ // LFE channel
lfe_64, // 64 indicates the interpolation factor to reconstruct the
- // LFE channel
+ // LFE channel
lfe_invalid
} lfe_type;
-
+
// if true, past frames will be used to predict ADPCM values for the
// current one. This means, if this flag is false, the current frame is
// better suited as an audio-jump-point (like an "I-frame" in video-coding).
- bool predictor_history_flag;
-
+ bool predictor_history_flag;
+
// which FIR coefficients to use for sub-band reconstruction
enum multirate_interpolator_enum {
mi_non_perfect,
mi_perfect
} multirate_interpolator;
-
+
// 0 to 15
unsigned int encoder_software_revision;
-
+
// 0 to 3 - "top-secret" bits indicating the "copy history" of the material
unsigned int copy_history;
-
+
// 16, 20 or 24 bits per sample, or -1 == invalid
int source_pcm_resolution;
- // if true, source surround channels are mastered in DTS-ES
+ // if true, source surround channels are mastered in DTS-ES
bool source_surround_in_es;
// if true, left and right front channels are encoded as
@@ -142,7 +142,7 @@ typedef struct dts_header_s {
// same as front_sum_difference for surround left and right channels
bool surround_sum_difference;
-
+
// gain in dB to apply for dialog normalization
int dialog_normalization_gain;
} dts_header_t;
View
10 install-sh
@@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
@@ -202,17 +202,17 @@ else
# If we're going to rename the final executable, determine the name now.
- if [ x"$transformarg" = x ]
+ if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
@@ -243,7 +243,7 @@ else
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
View
4 iso639.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: iso639.cpp,v 1.2 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: iso639.cpp,v 1.3 2003/05/20 06:30:24 mosu Exp $
\brief ISO639 language definitions, lookup functions
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -573,7 +573,7 @@ void list_iso639_languages() {
iso639_languages[i].english_name != NULL ?
iso639_languages[i].english_name : "",
iso639_languages[i].iso639_2_code,
- iso639_languages[i].iso639_1_code != NULL ?
+ iso639_languages[i].iso639_1_code != NULL ?
iso639_languages[i].iso639_1_code : "");
i++;
}
View
24 mkvinfo.cpp
@@ -12,7 +12,7 @@
/*!
\file
- \version \$Id: mkvinfo.cpp,v 1.40 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: mkvinfo.cpp,v 1.41 2003/05/20 06:30:24 mosu Exp $
\brief retrieves and displays information about a Matroska file
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -214,7 +214,7 @@ void process_file() {
es = new EbmlStream(static_cast<StdIOCallback &>(*in));
if (es == NULL)
die("new EbmlStream");
-
+
// Find the EbmlHead element. Must be the first one.
l0 = es->FindNextID(EbmlHead::ClassInfos, 0xFFFFFFFFL);
if (l0 == NULL) {
@@ -225,7 +225,7 @@ void process_file() {
l0->SkipData(static_cast<EbmlStream &>(*es), l0->Generic().Context);
delete l0;
fprintf(stdout, "(%s) + EBML head\n", NAME);
-
+
// Next element must be a segment
l0 = es->FindNextID(KaxSegment::ClassInfos, 0xFFFFFFFFL);
if (l0 == NULL) {
@@ -241,7 +241,7 @@ void process_file() {
if (verbose > 1)
fprintf(stdout, " at %llu", l0->GetElementPosition());
fprintf(stdout, "\n");
-
+
upper_lvl_el = 0;
exit_loop = 0;
// We've got our segment, so let's find the tracks
@@ -312,13 +312,13 @@ void process_file() {
if (verbose > 1)
fprintf(stdout, " at %llu", l1->GetElementPosition());
fprintf(stdout, "\n");
-
+
l2 = es->FindNextElement(l1->Generic().Context, upper_lvl_el,
0xFFFFFFFFL, true, 1);
while (l2 != NULL) {
if (upper_lvl_el != 0)
break;
-
+
if (EbmlId(*l2) == KaxTrackEntry::ClassInfos.GlobalId) {
// We actually found a track entry :) We're happy now.
fprintf(stdout, "(%s) | + a track", NAME);
@@ -333,7 +333,7 @@ void process_file() {
while (l3 != NULL) {
if (upper_lvl_el != 0)
break;
-
+
// Now evaluate the data belonging to this track
if (EbmlId(*l3) == KaxTrackNumber::ClassInfos.GlobalId) {
KaxTrackNumber &tnum = *static_cast<KaxTrackNumber *>(l3);
@@ -395,7 +395,7 @@ void process_file() {
while (l4 != NULL) {
if (upper_lvl_el != 0)
break;
-
+
if (EbmlId(*l4) ==
KaxAudioSamplingFreq::ClassInfos.GlobalId) {
KaxAudioSamplingFreq &freq =
@@ -601,7 +601,7 @@ void process_file() {
*static_cast<KaxTrackFlagLacing *>(l3);
f_lacing.ReadData(es->I_O());
fprintf(stdout, "(%s) | + Lacing flag: %d", NAME,
- uint32(f_lacing));
+ uint32(f_lacing));
if (verbose > 1)
fprintf(stdout, " at %llu", l3->GetElementPosition());
fprintf(stdout, "\n");
@@ -612,7 +612,7 @@ void process_file() {
*static_cast<KaxTrackFlagDefault *>(l3);
f_default.ReadData(es->I_O());
fprintf(stdout, "(%s) | + Default flag: %d", NAME,
- uint32(f_default));
+ uint32(f_default));
if (verbose > 1)
fprintf(stdout, " at %llu", l3->GetElementPosition());
fprintf(stdout, "\n");
@@ -799,7 +799,7 @@ void process_file() {
KaxClusterTimecode &ctc = *static_cast<KaxClusterTimecode *>(l2);
ctc.ReadData(es->I_O());
cluster_tc = uint64(ctc);
-
+
fprintf(stdout, "(%s) | + cluster timecode: %.3fs", NAME,
(float)cluster_tc * (float)tc_scale / 1000000000.0);
if (verbose > 1)
@@ -1177,7 +1177,7 @@ void process_file() {
0xFFFFFFFFL, true, 1);
}
} // while (l1 != NULL)
-
+
} catch (std::exception &ex) {
fprintf(stdout, "(%s) caught exception: %s\n", NAME, ex.what());
}
View
42 mkvmerge.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: mkvmerge.cpp,v 1.68 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: mkvmerge.cpp,v 1.69 2003/05/20 06:30:24 mosu Exp $
\brief command line parameter parsing, looping, output handling
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -91,7 +91,7 @@ typedef struct filelist_tag {
int type;
int status;
-
+
packet_t *pack;
generic_reader_c *reader;
@@ -308,7 +308,7 @@ static int get_type(char *filename) {
FILE *f = fopen(filename, "rb");
off_t size;
int type;
-
+
if (f == NULL) {
fprintf(stderr, "Error: could not open source file (%s).\n", filename);
exit(1);
@@ -345,7 +345,7 @@ static int get_type(char *filename) {
type = TYPEAAC;
// else if (microdvd_reader_c::probe_file(f, size))
// type = TYPEMICRODVD;
-// else if (vobsub_reader_c::probe_file(f, size))
+// else if (vobsub_reader_c::probe_file(f, size))
// type = TYPEVOBSUB;
// else if (chapter_information_probe(f, size))
// type = TYPECHAPTERS;
@@ -375,7 +375,7 @@ static int display_counter = 1;
static void display_progress(int force) {
filelist_t *winner, *current;
-
+
if (((display_counter % 500) == 0) || force) {
display_counter = 0;
winner = input;
@@ -404,7 +404,7 @@ static unsigned char *parse_tracks(char *s) {
char *nstart;
int n, ntracks;
unsigned char *tracks;
-
+
nstart = NULL;
tracks = NULL;
ntracks = 0;
@@ -435,7 +435,7 @@ static unsigned char *parse_tracks(char *s) {
}
c++;
}
-
+
if (nstart != NULL) {
n = atoi(nstart);
if ((n <= 0) || (n > 255)) {
@@ -449,14 +449,14 @@ static unsigned char *parse_tracks(char *s) {
nstart = NULL;
ntracks++;
}
-
+
return tracks;
}
static void parse_sync(char *s, audio_sync_t *async) {
char *linear, *div;
double d1, d2;
-
+
if ((linear = strchr(s, ',')) != NULL) {
*linear = 0;
linear++;
@@ -515,7 +515,7 @@ static float parse_aspect_ratio(char *s) {
// char *c, *a, *dot;
// int num_colons;
// double seconds;
-
+
// dot = strchr(s, '.');
// if (dot != NULL) {
// *dot = 0;
@@ -548,10 +548,10 @@ static float parse_aspect_ratio(char *s) {
// }
// seconds *= 60;
// seconds += atoi(a);
-
+
// if (dot != NULL)
// seconds += strtod(dot, NULL) / 1000.0;
-
+
// return seconds;
// }
@@ -591,7 +591,7 @@ static void render_headers(mm_io_callback *out) {
kax_tracks = &GetChild<KaxTracks>(*kax_segment);
kax_last_entry = NULL;
-
+
file = input;
while (file) {
file->reader->set_headers();
@@ -995,7 +995,7 @@ static void parse_args(int argc, char **argv) {
ti.aspect_ratio = 1.0;
}
}
-
+
if (input == NULL) {
usage();
exit(1);
@@ -1129,7 +1129,7 @@ int main(int argc, char **argv) {
}
render_headers(out);
-
+
/* let her rip! */
while (1) {
/* Step 1: make sure a packet is available for each output
@@ -1140,13 +1140,13 @@ int main(int argc, char **argv) {
while ((ptzr->pack == NULL) && (ptzr->status == EMOREDATA) &&
(ptzr->packetizer->packet_available() < 2))
ptzr->status = ptzr->packetizer->read();
- if (ptzr->pack == NULL)
+ if (ptzr->pack == NULL)
ptzr->pack = ptzr->packetizer->get_packet();
if ((ptzr->pack != NULL) && !ptzr->packetizer->packet_available())
ptzr->pack->duration_mandatory = 1;
}
- /* Step 2: Pick the packet with the lowest timecode and
+ /* Step 2: Pick the packet with the lowest timecode and
** stuff it into the Matroska file.
*/
winner = NULL;
@@ -1167,9 +1167,9 @@ int main(int argc, char **argv) {
/* Step 3: Write out the winning packet */
write_packet(pack);
-
+
winner->pack = NULL;
-
+
/* display some progress information */
if (verbose >= 1)
display_progress(0);
@@ -1183,7 +1183,7 @@ int main(int argc, char **argv) {
display_progress(1);
fprintf(stdout, "\n");
}
-
+
// Render the cues.
if (write_cues && cue_writing_requested) {
if (verbose == 1)
@@ -1248,7 +1248,7 @@ int main(int argc, char **argv) {
safefree(packetizers[packetizers.size() - 1]);
packetizers.pop_back();
}
-
+
delete out;
delete kax_segment;
delete kax_cues;
View
6 mp3_common.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: mp3_common.cpp,v 1.7 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: mp3_common.cpp,v 1.8 2003/05/20 06:30:24 mosu Exp $
\brief helper functions for MP3 data
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -31,10 +31,10 @@ long mp3_freqs[9] =
int find_mp3_header(unsigned char *buf, int size, unsigned long *_header) {
int i, pos;
unsigned long header;
-
+
if (size < 4)
return -1;
-
+
for (pos = 0; pos <= (size - 4); pos++) {
for (i = 0, header = 0; i < 4; i++) {
header <<= 8;
View
12 ogmstreams.h
@@ -1,13 +1,13 @@
#ifndef __OGGSTREAMS_H
#define __OGGSTREAMS_H
-/*
+/*
* Taken from http://tobias.everwicked.com/packfmt.htm
*
-
+
First packet (header)
---------------------
-
+
pos | content | description
-------+-------------------------+----------------------------------
0x0000 | 0x01 | indicates 'header packet'
@@ -18,7 +18,7 @@
Second packet (comment)
-----------------------
-
+
pos | content | description
-------+-------------------------+----------------------------------
0x0000 | 0x03 | indicates 'comment packet'
@@ -27,7 +27,7 @@
Data packets
------------
-
+
pos | content | description
---------+-------------------------+----------------------------------
0x0000 | Bit0 0 | indicates data packet
@@ -57,7 +57,7 @@ typedef struct stream_header_video
ogg_int32_t width;
ogg_int32_t height;
} stream_header_video;
-
+
typedef struct stream_header_audio
{
ogg_int16_t channels;
View
26 p_aac.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_aac.cpp,v 1.4 2003/05/19 20:51:12 mosu Exp $
+ \version \$Id: p_aac.cpp,v 1.5 2003/05/20 06:30:24 mosu Exp $
\brief AAC output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -55,9 +55,9 @@ aac_packetizer_c::~aac_packetizer_c() {
void aac_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
unsigned char *new_buffer;
-
+
new_buffer = (unsigned char *)saferealloc(packet_buffer, buffer_size + size);
-
+
memcpy(new_buffer + buffer_size, buf, size);
packet_buffer = new_buffer;
buffer_size += size;
@@ -66,20 +66,20 @@ void aac_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
int aac_packetizer_c::aac_packet_available() {
int pos;
aac_header_t aacheader;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_aac_header(packet_buffer, buffer_size, &aacheader);
if (pos < 0)
return 0;
-
+
return 1;
}
void aac_packetizer_c::remove_aac_packet(int pos, int framesize) {
int new_size;
unsigned char *temp_buf;
-
+
new_size = buffer_size - (pos + framesize);
if (new_size != 0)
temp_buf = (unsigned char *)safememdup(&packet_buffer[pos + framesize],
@@ -96,7 +96,7 @@ unsigned char *aac_packetizer_c::get_aac_packet(unsigned long *header,
int pos, i, up_shift, down_shift;
unsigned char *buf, *src;
double pims;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_aac_header(packet_buffer, buffer_size, aacheader);
@@ -116,9 +116,9 @@ unsigned char *aac_packetizer_c::get_aac_packet(unsigned long *header,
ti->async.displacement += (int)pims;
if (ti->async.displacement > -(pims / 2))
ti->async.displacement = 0;
-
+
remove_aac_packet(pos, aacheader->bytes);
-
+
return 0;
}
@@ -145,7 +145,7 @@ unsigned char *aac_packetizer_c::get_aac_packet(unsigned long *header,
buf[i] = (src[i] << up_shift);
}
}
-
+
if (ti->async.displacement > 0) {
/*
* AAC audio synchronization. displacement > 0 is solved by duplicating
@@ -157,12 +157,12 @@ unsigned char *aac_packetizer_c::get_aac_packet(unsigned long *header,
ti->async.displacement -= (int)pims;
if (ti->async.displacement < (pims / 2))
ti->async.displacement = 0;
-
+
return buf;
}
remove_aac_packet(pos, aacheader->bytes);
-
+
return buf;
}
@@ -207,7 +207,7 @@ int aac_packetizer_c::process(unsigned char *buf, int size,
add_to_buffer(buf, size);
while ((packet = get_aac_packet(&header, &aacheader)) != NULL) {
if (timecode == -1)
- my_timecode = (int64_t)(1000.0 * packetno * 1024 * ti->async.linear /
+ my_timecode = (int64_t)(1000.0 * packetno * 1024 * ti->async.linear /
samples_per_sec);
add_packet(packet, aacheader.data_byte_size, my_timecode,
View
6 p_aac.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_aac.h,v 1.4 2003/05/19 20:51:12 mosu Exp $
+ \version \$Id: p_aac.h,v 1.5 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the AAC output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_AAC_H
#define __P_AAC_H
@@ -42,7 +42,7 @@ class aac_packetizer_c: public generic_packetizer_c {
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
virtual void set_headers();
-
+
private:
virtual void add_to_buffer(unsigned char *buf, int size);
virtual unsigned char *get_aac_packet(unsigned long *header,
View
26 p_ac3.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_ac3.cpp,v 1.24 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_ac3.cpp,v 1.25 2003/05/20 06:30:24 mosu Exp $
\brief AC3 output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -52,9 +52,9 @@ ac3_packetizer_c::~ac3_packetizer_c() {
void ac3_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
unsigned char *new_buffer;
-
+
new_buffer = (unsigned char *)saferealloc(packet_buffer, buffer_size + size);
-
+
memcpy(new_buffer + buffer_size, buf, size);
packet_buffer = new_buffer;
buffer_size += size;
@@ -63,20 +63,20 @@ void ac3_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
int ac3_packetizer_c::ac3_packet_available() {
int pos;
ac3_header_t ac3header;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_ac3_header(packet_buffer, buffer_size, &ac3header);
if (pos < 0)
return 0;
-
+
return 1;
}
void ac3_packetizer_c::remove_ac3_packet(int pos, int framesize) {
int new_size;
unsigned char *temp_buf;
-
+
new_size = buffer_size - (pos + framesize);
if (new_size != 0)
temp_buf = (unsigned char *)safememdup(&packet_buffer[pos + framesize],
@@ -93,7 +93,7 @@ unsigned char *ac3_packetizer_c::get_ac3_packet(unsigned long *header,
int pos;
unsigned char *buf;
double pims;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_ac3_header(packet_buffer, buffer_size, ac3header);
@@ -113,9 +113,9 @@ unsigned char *ac3_packetizer_c::get_ac3_packet(unsigned long *header,
ti->async.displacement += (int)pims;
if (ti->async.displacement > -(pims / 2))
ti->async.displacement = 0;
-
+
remove_ac3_packet(pos, ac3header->bytes);
-
+
return 0;
}
@@ -124,7 +124,7 @@ unsigned char *ac3_packetizer_c::get_ac3_packet(unsigned long *header,
"found). This might make audio/video go out of sync, but this "
"stream is damaged.\n", pos);
buf = (unsigned char *)safememdup(packet_buffer + pos, ac3header->bytes);
-
+
if (ti->async.displacement > 0) {
/*
* AC3 audio synchronization. displacement > 0 is solved by duplicating
@@ -136,12 +136,12 @@ unsigned char *ac3_packetizer_c::get_ac3_packet(unsigned long *header,
ti->async.displacement -= (int)pims;
if (ti->async.displacement < (pims / 2))
ti->async.displacement = 0;
-
+
return buf;
}
remove_ac3_packet(pos, ac3header->bytes);
-
+
return buf;
}
@@ -166,7 +166,7 @@ int ac3_packetizer_c::process(unsigned char *buf, int size,
add_to_buffer(buf, size);
while ((packet = get_ac3_packet(&header, &ac3header)) != NULL) {
if (timecode == -1)
- my_timecode = (int64_t)(1000.0 * packetno * 1536 * ti->async.linear /
+ my_timecode = (int64_t)(1000.0 * packetno * 1536 * ti->async.linear /
samples_per_sec);
add_packet(packet, ac3header.bytes, my_timecode,
View
6 p_ac3.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_ac3.h,v 1.15 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_ac3.h,v 1.16 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the AC3 output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_AC3_H
#define __P_AC3_H
@@ -41,7 +41,7 @@ class ac3_packetizer_c: public generic_packetizer_c {
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
virtual void set_headers();
-
+
private:
virtual void add_to_buffer(unsigned char *buf, int size);
virtual unsigned char *get_ac3_packet(unsigned long *header,
View
54 p_dts.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_dts.cpp,v 1.5 2003/05/20 06:27:08 mosu Exp $
+ \version \$Id: p_dts.cpp,v 1.6 2003/05/20 06:30:24 mosu Exp $
\brief DTS output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -91,14 +91,14 @@ dts_packetizer_c::dts_packetizer_c(generic_reader_c *nreader,
//packetno = 0;
samples_written = 0;
bytes_written = 0;
-
+
packet_buffer = NULL;
buffer_size = 0;
skipping_is_normal = false;
-
+
first_header = dtsheader;
last_header = dtsheader;
-
+
set_track_type(track_audio);
duplicate_data_on_add(false);
}
@@ -114,9 +114,9 @@ dts_packetizer_c::~dts_packetizer_c() {
void dts_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
unsigned char *new_buffer;
-
+
new_buffer = (unsigned char *)saferealloc(packet_buffer, buffer_size + size);
-
+
memcpy(new_buffer + buffer_size, buf, size);
packet_buffer = new_buffer;
buffer_size += size;
@@ -125,21 +125,21 @@ void dts_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
int dts_packetizer_c::dts_packet_available() {
int pos;
dts_header_t dtsheader;
-
+
if (packet_buffer == NULL)
return 0;
-
+
pos = find_dts_header(packet_buffer, buffer_size, &dtsheader);
if (pos < 0)
return 0;
-
+
return 1;
}
void dts_packetizer_c::remove_dts_packet(int pos, int framesize) {
int new_size;
unsigned char *temp_buf;
-
+
new_size = buffer_size - (pos + framesize);
if (new_size != 0)
temp_buf = (unsigned char *)safememdup(&packet_buffer[pos + framesize],
@@ -155,7 +155,7 @@ unsigned char *dts_packetizer_c::get_dts_packet(dts_header_t &dtsheader) {
int pos;
unsigned char *buf;
double pims;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_dts_header(packet_buffer, buffer_size, &dtsheader);
@@ -172,7 +172,7 @@ unsigned char *dts_packetizer_c::get_dts_packet(dts_header_t &dtsheader) {
pims = get_dts_packet_length_in_milliseconds(&dtsheader);
-
+
if (ti->async.displacement < 0) {
/*
* DTS audio synchronization. displacement < 0 means skipping an
@@ -181,9 +181,9 @@ unsigned char *dts_packetizer_c::get_dts_packet(dts_header_t &dtsheader) {
ti->async.displacement += (int)pims;
if (ti->async.displacement > -(pims / 2))
ti->async.displacement = 0;
-
+
remove_dts_packet(pos, dtsheader.frame_byte_size);
-
+
return 0;
}
@@ -191,10 +191,10 @@ unsigned char *dts_packetizer_c::get_dts_packet(dts_header_t &dtsheader) {
fprintf(stdout, "dts_packetizer: skipping %d bytes (no valid DTS header "
"found). This might make audio/video go out of sync, but this "
"stream is damaged.\n", pos);
-
+
buf = (unsigned char *)safememdup(packet_buffer + pos,
dtsheader.frame_byte_size);
-
+
if (ti->async.displacement > 0) {
/*
* DTS audio synchronization. displacement > 0 is solved by duplicating
@@ -206,12 +206,12 @@ unsigned char *dts_packetizer_c::get_dts_packet(dts_header_t &dtsheader) {
ti->async.displacement -= (int)pims;
if (ti->async.displacement < (pims / 2))
ti->async.displacement = 0;
-
+
return buf;
}
remove_dts_packet(pos, dtsheader.frame_byte_size);
-
+
return buf;
}
@@ -225,31 +225,31 @@ void dts_packetizer_c::set_headers() {
int dts_packetizer_c::process(unsigned char *buf, int size,
int64_t timecode, int64_t, int64_t, int64_t) {
-
- int64_t my_timecode;
+
+ int64_t my_timecode;
if (timecode != -1) my_timecode = timecode;
-
+
add_to_buffer(buf, size);
-
+
dts_header_t dtsheader;
unsigned char *packet;
while ((packet = get_dts_packet(dtsheader)) != NULL) {
int64_t packet_len_in_ms =
(int64_t)get_dts_packet_length_in_milliseconds(&dtsheader);
-
+
if (timecode == -1)
my_timecode = (int64_t)(((double)samples_written*1000.0) /
((double)dtsheader.core_sampling_frequency));
-
+
// fprintf(stderr,"DTS packet timecode %lld len %lld\n", my_timecode,
// packet_len_in_ms);
-
+
add_packet(packet, dtsheader.frame_byte_size, my_timecode,
packet_len_in_ms);
-
+
bytes_written += dtsheader.frame_byte_size;
samples_written += get_dts_packet_length_in_core_samples(&dtsheader);
}
-
+
return EMOREDATA;
}
View
14 p_dts.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_dts.h,v 1.4 2003/05/20 06:27:08 mosu Exp $
+ \version \$Id: p_dts.h,v 1.5 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the DTS output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_DTS_H
#define __P_DTS_H
@@ -28,17 +28,17 @@
class dts_packetizer_c: public generic_packetizer_c {
private:
int64_t samples_written, bytes_written;
-
+
int buffer_size;
-
+
unsigned char *packet_buffer;
-
+
dts_header_t first_header;
dts_header_t last_header;
public:
bool skipping_is_normal;
-
+
dts_packetizer_c(generic_reader_c *nreader, const dts_header_t &dts_header,
track_info_t *nti) throw (error_c);
virtual ~dts_packetizer_c();
@@ -47,7 +47,7 @@ class dts_packetizer_c: public generic_packetizer_c {
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
virtual void set_headers();
-
+
private:
virtual void add_to_buffer(unsigned char *buf, int size);
virtual unsigned char *get_dts_packet(dts_header_t &dts_header);
View
26 p_mp3.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_mp3.cpp,v 1.26 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_mp3.cpp,v 1.27 2003/05/20 06:30:24 mosu Exp $
\brief MP3 output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -52,9 +52,9 @@ mp3_packetizer_c::~mp3_packetizer_c() {
void mp3_packetizer_c::add_to_buffer(unsigned char *buf, int size) {
unsigned char *new_buffer;
-
+
new_buffer = (unsigned char *)saferealloc(packet_buffer, buffer_size + size);
-
+
memcpy(new_buffer + buffer_size, buf, size);
packet_buffer = new_buffer;
buffer_size += size;
@@ -64,7 +64,7 @@ int mp3_packetizer_c::mp3_packet_available() {
unsigned long header;
int pos;
mp3_header_t mp3header;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_mp3_header(packet_buffer, buffer_size, &header);
@@ -73,14 +73,14 @@ int mp3_packetizer_c::mp3_packet_available() {
decode_mp3_header(header, &mp3header);
if ((pos + mp3header.framesize + 4) > buffer_size)
return 0;
-
+
return 1;
}
void mp3_packetizer_c::remove_mp3_packet(int pos, int framesize) {
int new_size;
unsigned char *temp_buf;
-
+
new_size = buffer_size - (pos + framesize + 4) + 1;
temp_buf = (unsigned char *)safemalloc(new_size);
if (new_size != 0)
@@ -95,7 +95,7 @@ unsigned char *mp3_packetizer_c::get_mp3_packet(unsigned long *header,
int pos;
unsigned char *buf;
double pims;
-
+
if (packet_buffer == NULL)
return 0;
pos = find_mp3_header(packet_buffer, buffer_size, header);
@@ -115,9 +115,9 @@ unsigned char *mp3_packetizer_c::get_mp3_packet(unsigned long *header,
ti->async.displacement += (int)pims;
if (ti->async.displacement > -(pims / 2))
ti->async.displacement = 0;
-
+
remove_mp3_packet(pos, mp3header->framesize);
-
+
return 0;
}
@@ -126,7 +126,7 @@ unsigned char *mp3_packetizer_c::get_mp3_packet(unsigned long *header,
"found).\n", pos);
buf = (unsigned char *)safememdup(packet_buffer + pos, mp3header->framesize
+ 4);
-
+
if (ti->async.displacement > 0) {
/*
* MP3 audio synchronization. displacement > 0 is solved by creating
@@ -138,7 +138,7 @@ unsigned char *mp3_packetizer_c::get_mp3_packet(unsigned long *header,
if (ti->async.displacement < (pims / 2))
ti->async.displacement = 0;
memset(buf + 4, 0, mp3header->framesize);
-
+
return buf;
}
@@ -175,10 +175,10 @@ int mp3_packetizer_c::process(unsigned char *buf, int size,
safefree(packet);
packetno++;
return EMOREDATA;
- }
+ }
if (timecode == -1)
- my_timecode = (int64_t)(1000.0 * packetno * 1152 * ti->async.linear /
+ my_timecode = (int64_t)(1000.0 * packetno * 1152 * ti->async.linear /
samples_per_sec);
add_packet(packet, mp3header.framesize + 4, my_timecode,
View
4 p_mp3.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_mp3.h,v 1.16 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_mp3.h,v 1.17 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the MP3 output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_MP3_H
#define __P_MP3_H
View
6 p_pcm.cpp
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_pcm.cpp,v 1.24 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_pcm.cpp,v 1.25 2003/05/20 06:30:24 mosu Exp $
\brief PCM output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -68,7 +68,7 @@ int pcm_packetizer_c::process(unsigned char *buf, int size,
int i, bytes_per_packet, remaining_bytes, complete_packets;
unsigned char *new_buf;
- if (size > tempbuf_size) {
+ if (size > tempbuf_size) {
tempbuf = (unsigned char *)saferealloc(tempbuf, size + 128);
tempbuf_size = size;
}
View
8 p_pcm.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_pcm.h,v 1.16 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_pcm.h,v 1.17 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the PCM output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_PCM_H
#define __P_PCM_H
@@ -30,13 +30,13 @@ class pcm_packetizer_c: public generic_packetizer_c {
int64_t bytes_output, remaining_sync;
unsigned long samples_per_sec;
unsigned char *tempbuf;
-
+
public:
pcm_packetizer_c(generic_reader_c *nreader, unsigned long nsamples_per_sec,
int nchannels, int nbits_per_sample, track_info_t *nti)
throw (error_c);
virtual ~pcm_packetizer_c();
-
+
virtual int process(unsigned char *buf, int size, int64_t timecode = -1,
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
View
4 p_textsubs.h
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_textsubs.h,v 1.8 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_textsubs.h,v 1.9 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the simple text subtitle packetizer
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -33,7 +33,7 @@ class textsubs_packetizer_c: public generic_packetizer_c {
textsubs_packetizer_c(generic_reader_c *nreader, track_info_t *nti)
throw (error_c);
virtual ~textsubs_packetizer_c();
-
+
virtual int process(unsigned char *_subs, int size, int64_t start = -1,
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
View
4 p_video.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_video.cpp,v 1.34 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_video.cpp,v 1.35 2003/05/20 06:30:24 mosu Exp $
\brief video output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -88,7 +88,7 @@ int video_packetizer_c::process(unsigned char *buf, int size,
}
frames_output++;
-
+
return EMOREDATA;
}
View
6 p_video.h
@@ -13,11 +13,11 @@
/*!
\file
- \version \$Id: p_video.h,v 1.25 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_video.h,v 1.26 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the video output module
\author Moritz Bunkus <moritz@bunkus.org>
*/
-
+
#ifndef __P_VIDEO_H
#define __P_VIDEO_H
@@ -40,7 +40,7 @@ class video_packetizer_c: public generic_packetizer_c {
int nheight, int nbpp, int navi_compat_mode,
track_info_t *nti) throw (error_c);
virtual ~video_packetizer_c();
-
+
virtual int process(unsigned char *buf, int size, int64_t old_timecode = -1,
int64_t flags = VFT_IFRAME, int64_t bref = -1,
int64_t fref = -1);
View
10 p_vorbis.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_vorbis.cpp,v 1.24 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_vorbis.cpp,v 1.25 2003/05/20 06:30:24 mosu Exp $
\brief Vorbis packetizer
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -82,7 +82,7 @@ vorbis_packetizer_c::~vorbis_packetizer_c() {
void vorbis_packetizer_c::set_headers() {
unsigned char *buffer;
int n, offset, i, lsize;
-
+
set_codec_id(MKV_A_VORBIS);
// We use lacing for the blocks. The first bytes is the number of
@@ -124,7 +124,7 @@ void vorbis_packetizer_c::set_headers() {
generic_packetizer_c::set_headers();
}
-/*
+/*
* Some notes - processing is straight-forward if no AV synchronization
* is needed - the packet is simply stored in the Matroska file.
* Unfortunately things are not that easy if AV sync is done. For a
@@ -137,7 +137,7 @@ int vorbis_packetizer_c::process(unsigned char *data, int size,
unsigned char zero[2];
ogg_packet op;
int64_t this_bs, samples_here, samples_needed;
-
+
// Recalculate the timecode if needed.
if (timecode == -1)
timecode = samples * 1000 / vi.rate;
@@ -190,5 +190,5 @@ int vorbis_packetizer_c::process(unsigned char *data, int size,
return EMOREDATA;
}
-
+
#endif // HAVE_OGGVORBIS
View
4 p_vorbis.h
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: p_vorbis.h,v 1.13 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: p_vorbis.h,v 1.14 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the Vorbis packetizer
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -47,7 +47,7 @@ class vorbis_packetizer_c: public generic_packetizer_c {
unsigned char *d_codecsetup, int l_codecsetup,
track_info_t *nti) throw (error_c);
virtual ~vorbis_packetizer_c();
-
+
virtual int process(unsigned char *data, int size, int64_t timecode = -1,
int64_t length = -1, int64_t bref = -1,
int64_t fref = -1);
View
4 pr_generic.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: pr_generic.cpp,v 1.42 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: pr_generic.cpp,v 1.43 2003/05/20 06:30:24 mosu Exp $
\brief functions common for all readers/packetizers
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -245,7 +245,7 @@ void generic_packetizer_c::set_headers() {
}
if (hcodec_private != NULL) {
- KaxCodecPrivate &codec_private =
+ KaxCodecPrivate &codec_private =
GetChild<KaxCodecPrivate>(static_cast<KaxTrackEntry &>(*track_entry));
codec_private.CopyBuffer((binary *)hcodec_private, hcodec_private_length);
}
View
4 pr_generic.h
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: pr_generic.h,v 1.42 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: pr_generic.h,v 1.43 2003/05/20 06:30:24 mosu Exp $
\brief class definition for the generic reader and packetizer
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -151,7 +151,7 @@ class generic_packetizer_c {
virtual void set_as_default_track(int type);
virtual void force_default_track(int type);
};
-
+
class generic_reader_c {
protected:
track_info_t *ti;
View
14 r_aac.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: r_aac.cpp,v 1.4 2003/05/19 20:51:12 mosu Exp $
+ \version \$Id: r_aac.cpp,v 1.5 2003/05/20 06:30:24 mosu Exp $
\brief AAC demultiplexer module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -29,10 +29,10 @@
#include "r_aac.h"
#include "p_aac.h"
-int aac_reader_c::probe_file(FILE *file, int64_t size) {
+int aac_reader_c::probe_file(FILE *file, int64_t size) {
char buf[4096];
aac_header_t aacheader;
-
+
if (size < 4096)
return 0;
if (fseek(file, 0, SEEK_SET) != 0)
@@ -47,15 +47,15 @@ int aac_reader_c::probe_file(FILE *file, int64_t size) {
return 1;
if (find_aac_header((unsigned char *)buf, 4096, &aacheader) < 0)
return 0;
-
- return 1;
+
+ return 1;
}
aac_reader_c::aac_reader_c(track_info_t *nti) throw (error_c):
generic_reader_c(nti) {
int adif;
aac_header_t aacheader;
-
+
if ((file = fopen(ti->fname, "rb")) == NULL)
throw error_c("aac_reader: Could not open source file.");
if (fseek(file, 0, SEEK_END) != 0)
@@ -96,7 +96,7 @@ aac_reader_c::~aac_reader_c() {
int aac_reader_c::read() {
int nread;
-
+
nread = fread(chunk, 1, 4096, file);
if (nread <= 0)
return 0;
View
4 r_aac.h
@@ -13,7 +13,7 @@
/*!
\file r_avi.h
- \version \$Id: r_aac.h,v 1.2 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: r_aac.h,v 1.3 2003/05/20 06:30:24 mosu Exp $
\brief class definitions for the AVI demultiplexer module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -35,7 +35,7 @@ class aac_reader_c: public generic_reader_c {
FILE *file;
class aac_packetizer_c *aacpacketizer;
int64_t bytes_processed, size;
-
+
public:
aac_reader_c(track_info_t *nti) throw (error_c);
virtual ~aac_reader_c();
View
16 r_ac3.cpp
@@ -13,7 +13,7 @@
/*!
\file
- \version \$Id: r_ac3.cpp,v 1.21 2003/05/18 20:57:07 mosu Exp $
+ \version \$Id: r_ac3.cpp,v 1.22 2003/05/20 06:30:24 mosu Exp $
\brief AC3 demultiplexer module
\author Moritz Bunkus <moritz@bunkus.org>
*/
@@ -33,11 +33,11 @@ extern "C" {
#include "r_ac3.h"
#include "p_ac3.h"
-int ac3_reader_c::probe_file(FILE *file, int64_t size) {
+int ac3_reader_c::probe_file(FILE *file, int64_t size) {
char buf[4096];
int pos;
ac3_header_t ac3header;
-
+
if (size < 4096)
return 0;
if (fseek(file, 0, SEEK_SET) != 0)
@@ -47,19 +47,19 @@ int ac3_reader_c::probe_file(FILE *file, int64_t size) {
return 0;
}
fseek(file, 0, SEEK_SET);
-
+
pos = find_ac3_header((unsigned char *)buf, 4096, &ac3header);
if (pos < 0)
return 0;
-
- return 1;
+
+ return 1;
}
ac3_reader_c::ac3_reader_c(track_info_t *nti) throw (error_c):
generic_reader_c(nti) {