From 840e6fd154837bce33b53ee999be051846072f4d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 7 Jun 2003 14:30:10 +0000 Subject: [PATCH] More VC6 compatibility fixes. More libmatroska 0.4.4 updates. --- common.h | 4 +++- mkvinfo.cpp | 8 ++++---- mkvmerge.cpp | 4 ++-- pr_generic.cpp | 9 ++++----- r_matroska.cpp | 8 ++++---- r_matroska.h | 5 +---- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/common.h b/common.h index b52febca5..0b9addd87 100644 --- a/common.h +++ b/common.h @@ -13,7 +13,7 @@ /*! \file - \version \$Id: common.h,v 1.34 2003/06/07 12:26:08 mosu Exp $ + \version \$Id: common.h,v 1.35 2003/06/07 14:30:10 mosu Exp $ \brief definitions used in all programs, helper functions \author Moritz Bunkus */ @@ -36,6 +36,8 @@ #define strncasecmp _strnicmp #define strcasecmp _stricmp #define nice(a) +#define vsnprintf _vsnprintf +#define vfprintf _vfprintf #endif #include "EbmlUnicodeString.h" diff --git a/mkvinfo.cpp b/mkvinfo.cpp index 2d950d350..9b1c9a9cf 100644 --- a/mkvinfo.cpp +++ b/mkvinfo.cpp @@ -12,7 +12,7 @@ /*! \file - \version \$Id: mkvinfo.cpp,v 1.56 2003/06/07 12:26:08 mosu Exp $ + \version \$Id: mkvinfo.cpp,v 1.57 2003/06/07 14:30:10 mosu Exp $ \brief retrieves and displays information about a Matroska file \author Moritz Bunkus */ @@ -523,10 +523,10 @@ bool process_file(const char *file_name) { } else if (EbmlId(*l3) == KaxCodecID::ClassInfos.GlobalId) { KaxCodecID &codec_id = *static_cast(l3); codec_id.ReadData(es->I_O()); - show_element(l3, 3, "Codec ID: %s", &binary(codec_id)); - if ((!strcmp((char *)&binary(codec_id), MKV_V_MSCOMP) && + show_element(l3, 3, "Codec ID: %s", string(codec_id).c_str()); + if ((!strcmp(string(codec_id).c_str(), MKV_V_MSCOMP) && (mkv_track_type == 'v')) || - (!strcmp((char *)&binary(codec_id), MKV_A_ACM) && + (!strcmp(string(codec_id).c_str(), MKV_A_ACM) && (mkv_track_type == 'a'))) ms_compat = true; diff --git a/mkvmerge.cpp b/mkvmerge.cpp index 721219b18..4c38dac57 100644 --- a/mkvmerge.cpp +++ b/mkvmerge.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: mkvmerge.cpp,v 1.86 2003/06/07 12:26:08 mosu Exp $ + \version \$Id: mkvmerge.cpp,v 1.87 2003/06/07 14:30:10 mosu Exp $ \brief command line parameter parsing, looping, output handling \author Moritz Bunkus */ @@ -506,7 +506,7 @@ static void render_headers(mm_io_c *out) { *(static_cast(kax_duration)) = 0.0; string version = string("libebml v") + EbmlCodeVersion + - string(" + libmatroska v") + KaxCodeVersion + string("äöü!!!"); + string(" + libmatroska v") + KaxCodeVersion; *((EbmlUnicodeString *)&GetChild(*kax_infos)) = cstr_to_UTFstring(version.c_str()); *((EbmlUnicodeString *)&GetChild(*kax_infos)) = diff --git a/pr_generic.cpp b/pr_generic.cpp index 1db8f9528..6f7cfaeed 100644 --- a/pr_generic.cpp +++ b/pr_generic.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: pr_generic.cpp,v 1.49 2003/06/07 12:26:08 mosu Exp $ + \version \$Id: pr_generic.cpp,v 1.50 2003/06/07 14:30:10 mosu Exp $ \brief functions common for all readers/packetizers \author Moritz Bunkus */ @@ -239,10 +239,9 @@ void generic_packetizer_c::set_headers() { *(static_cast (&GetChild(*track_entry))) = htrack_type; - if (hcodec_id != NULL) { - KaxCodecID &codec_id = GetChild(*track_entry); - codec_id.CopyBuffer((binary *)hcodec_id, strlen(hcodec_id) + 1); - } + if (hcodec_id != NULL) + *(static_cast + (&GetChild(*track_entry))) = hcodec_id; if (hcodec_private != NULL) { KaxCodecPrivate &codec_private = GetChild(*track_entry); diff --git a/r_matroska.cpp b/r_matroska.cpp index 63def974d..48ee7703e 100644 --- a/r_matroska.cpp +++ b/r_matroska.cpp @@ -13,7 +13,7 @@ /*! \file - \version \$Id: r_matroska.cpp,v 1.44 2003/06/07 12:26:08 mosu Exp $ + \version \$Id: r_matroska.cpp,v 1.45 2003/06/07 14:30:10 mosu Exp $ \brief Matroska reader \author Moritz Bunkus */ @@ -446,7 +446,7 @@ int mkv_reader_c::read_headers() { upper_lvl_el = 0; exit_loop = 0; - tc_scale = MKVD_TIMECODESCALE; + tc_scale = TIMECODE_SCALE; // We've got our segment, so let's find the tracks l1 = es->FindNextElement(l0->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true, 1); @@ -705,8 +705,8 @@ int mkv_reader_c::read_headers() { KaxCodecID &codec_id = *static_cast(l3); codec_id.ReadData(es->I_O()); fprintf(stdout, "matroska_reader: | + Codec ID: %s\n", - &binary(codec_id)); - track->codec_id = safestrdup((char *)&binary(codec_id)); + string(codec_id).c_str()); + track->codec_id = safestrdup(string(codec_id).c_str()); } else if (EbmlId(*l3) == KaxCodecPrivate::ClassInfos.GlobalId) { KaxCodecPrivate &c_priv = *static_cast(l3); diff --git a/r_matroska.h b/r_matroska.h index 76a7e089e..25d47cb12 100644 --- a/r_matroska.h +++ b/r_matroska.h @@ -13,7 +13,7 @@ /*! \file - \version \$Id: r_matroska.h,v 1.15 2003/05/23 06:34:57 mosu Exp $ + \version \$Id: r_matroska.h,v 1.16 2003/06/07 14:30:10 mosu Exp $ \brief class definitions for the Matroska reader \author Moritz Bunkus */ @@ -34,9 +34,6 @@ using namespace LIBMATROSKA_NAMESPACE; -// default values for Matroska elements -#define MKVD_TIMECODESCALE 1000000 // 1000000 = 1ms - typedef struct { uint32_t tnum, tuid;