mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
Removed the --sub-type switch as all text subtitles will be stored in UTF-8 format. Made iconv mandatory in the configure checks for this very reason.
This commit is contained in:
parent
8f57678027
commit
abdfbd9be3
@ -1,5 +1,9 @@
|
|||||||
2003-05-29 Moritz Bunkus <moritz@bunkus.org>
|
2003-05-29 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
|
* Removed the '--sub-type' switch as all text subtitles will be
|
||||||
|
stored in UTF-8 format. Made iconv mandatory in the configure
|
||||||
|
checks for this very reason.
|
||||||
|
|
||||||
* Added a GUI to mkvinfo.
|
* Added a GUI to mkvinfo.
|
||||||
|
|
||||||
2003-05-23 Moritz Bunkus <moritz@bunkus.org>
|
2003-05-23 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
@ -557,16 +557,13 @@ AC_DEFUN(PATH_CYGWIN,
|
|||||||
CYGWIN="`uname -s`"
|
CYGWIN="`uname -s`"
|
||||||
case "$CYGWIN" in
|
case "$CYGWIN" in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
ICONV_LIBS="-liconv"
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
CXXVER_CFLAGS="$CXXVER_CFLAGS -DNO_WSTRING"
|
CXXVER_CFLAGS="$CXXVER_CFLAGS -DNO_WSTRING"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
ICONV_LIBS=""
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AC_SUBST(ICONV_LIBS)
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl This macros shamelessly stolen from
|
dnl This macros shamelessly stolen from
|
||||||
@ -609,7 +606,6 @@ AC_DEFUN(PATH_ICONV,
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
if test "$am_cv_func_iconv" = yes; then
|
if test "$am_cv_func_iconv" = yes; then
|
||||||
dnl AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
|
||||||
AC_MSG_CHECKING([for iconv declaration])
|
AC_MSG_CHECKING([for iconv declaration])
|
||||||
AC_CACHE_VAL(am_cv_proto_iconv, [
|
AC_CACHE_VAL(am_cv_proto_iconv, [
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
@ -631,6 +627,10 @@ size_t iconv();
|
|||||||
}[$]am_cv_proto_iconv)
|
}[$]am_cv_proto_iconv)
|
||||||
dnl AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
|
dnl AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
|
||||||
dnl [Define as const if the declaration of iconv() needs const.])
|
dnl [Define as const if the declaration of iconv() needs const.])
|
||||||
|
else
|
||||||
|
echo '*** The iconv library is needed but could not be found.'
|
||||||
|
echo '*** Please install it and re-run configure.'
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
ICONV_LIBS=
|
ICONV_LIBS=
|
||||||
if test "$am_cv_lib_iconv" = yes; then
|
if test "$am_cv_lib_iconv" = yes; then
|
||||||
|
@ -557,16 +557,13 @@ AC_DEFUN(PATH_CYGWIN,
|
|||||||
CYGWIN="`uname -s`"
|
CYGWIN="`uname -s`"
|
||||||
case "$CYGWIN" in
|
case "$CYGWIN" in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
dnl ICONV_LIBS="-liconv"
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
CXXVER_CFLAGS="$CXXVER_CFLAGS -DNO_WSTRING"
|
CXXVER_CFLAGS="$CXXVER_CFLAGS -DNO_WSTRING"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
dnl ICONV_LIBS=""
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
dnl AC_SUBST(ICONV_LIBS)
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl This macros shamelessly stolen from
|
dnl This macros shamelessly stolen from
|
||||||
@ -609,7 +606,6 @@ AC_DEFUN(PATH_ICONV,
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
if test "$am_cv_func_iconv" = yes; then
|
if test "$am_cv_func_iconv" = yes; then
|
||||||
dnl AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
|
||||||
AC_MSG_CHECKING([for iconv declaration])
|
AC_MSG_CHECKING([for iconv declaration])
|
||||||
AC_CACHE_VAL(am_cv_proto_iconv, [
|
AC_CACHE_VAL(am_cv_proto_iconv, [
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
@ -631,6 +627,10 @@ size_t iconv();
|
|||||||
}[$]am_cv_proto_iconv)
|
}[$]am_cv_proto_iconv)
|
||||||
dnl AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
|
dnl AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
|
||||||
dnl [Define as const if the declaration of iconv() needs const.])
|
dnl [Define as const if the declaration of iconv() needs const.])
|
||||||
|
else
|
||||||
|
echo '*** The iconv library is needed but could not be found.'
|
||||||
|
echo '*** Please install it and re-run configure.'
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
ICONV_LIBS=
|
ICONV_LIBS=
|
||||||
if test "$am_cv_lib_iconv" = yes; then
|
if test "$am_cv_lib_iconv" = yes; then
|
||||||
|
11
mkvmerge.1
11
mkvmerge.1
@ -123,16 +123,7 @@ Forces the FourCC to the specified value. Works only for video tracks.
|
|||||||
Sets the aspect ratio for the track. The ratio can be given either as a
|
Sets the aspect ratio for the track. The ratio can be given either as a
|
||||||
floating point number or as 'widht/height', e.g. 16/9.
|
floating point number or as 'widht/height', e.g. 16/9.
|
||||||
.LP
|
.LP
|
||||||
Options that only apply to text subtitle tracks:
|
Options that only apply to subtitle tracks:
|
||||||
.TP
|
|
||||||
\fB\-\-sub\-format\fR <\fIutf8\fR|\fIascii\fR>
|
|
||||||
If the format chosen is \fIutf8\fR then text subtitles will be recoded to
|
|
||||||
UTF-8, and the track's codec ID will be set to S_TEXT/UTF8. \fIascii\fR does
|
|
||||||
no conversion, and S_TEXT/ASCII will be used instead. \fBmkvmerge\fR uses the
|
|
||||||
current locale to determine the charset from which to convert which can be
|
|
||||||
overridden with \fB\-\-sub\-charset\fR.
|
|
||||||
.br
|
|
||||||
The default is utf8.
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-sub\-charset\fR
|
\fB\-\-sub\-charset\fR
|
||||||
Sets the charset for the conversion to UTF-8 for UTF-8 subtitles. If not
|
Sets the charset for the conversion to UTF-8 for UTF-8 subtitles. If not
|
||||||
|
21
mkvmerge.cpp
21
mkvmerge.cpp
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file
|
\file
|
||||||
\version \$Id: mkvmerge.cpp,v 1.81 2003/05/25 15:35:39 mosu Exp $
|
\version \$Id: mkvmerge.cpp,v 1.82 2003/05/29 18:50:03 mosu Exp $
|
||||||
\brief command line parameter parsing, looping, output handling
|
\brief command line parameter parsing, looping, output handling
|
||||||
\author Moritz Bunkus <moritz@bunkus.org>
|
\author Moritz Bunkus <moritz@bunkus.org>
|
||||||
*/
|
*/
|
||||||
@ -211,9 +211,6 @@ static void usage(void) {
|
|||||||
" Works only for video tracks.\n"
|
" Works only for video tracks.\n"
|
||||||
" --aspect-ratio <f|a/b> Sets the aspect ratio.\n"
|
" --aspect-ratio <f|a/b> Sets the aspect ratio.\n"
|
||||||
"\n Options that only apply to text subtitle tracks:\n"
|
"\n Options that only apply to text subtitle tracks:\n"
|
||||||
" --sub-format <utf8| Converts text subtitles to UTF-8 or not.\n"
|
|
||||||
" ascii> keeps them as they are and assumes ASCII\n"
|
|
||||||
" encoding.\n"
|
|
||||||
" --sub-charset Sets the charset the text subtitles are\n"
|
" --sub-charset Sets the charset the text subtitles are\n"
|
||||||
" written in for the conversion to UTF-8.\n"
|
" written in for the conversion to UTF-8.\n"
|
||||||
"\n\n Other options:\n"
|
"\n\n Other options:\n"
|
||||||
@ -754,22 +751,6 @@ static void parse_args(int argc, char **argv) {
|
|||||||
} else if (!strcmp(argv[i], "--default-track"))
|
} else if (!strcmp(argv[i], "--default-track"))
|
||||||
ti.default_track = 1;
|
ti.default_track = 1;
|
||||||
|
|
||||||
else if (!strcmp(argv[i], "--sub-type")) {
|
|
||||||
if ((i + 1) >= argc) {
|
|
||||||
fprintf(stderr, "Error: --sub-type lacks its argument.\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (!strcmp(argv[i + 1], "utf8"))
|
|
||||||
ti.no_utf8_subs = 0;
|
|
||||||
else if (!strcmp(argv[i + 1], "ascii"))
|
|
||||||
ti.no_utf8_subs = 1;
|
|
||||||
else {
|
|
||||||
fprintf(stderr, "Error: '%s' is an unsupported subtitle type.\n",
|
|
||||||
argv[i + 1]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (!strcmp(argv[i], "--language")) {
|
else if (!strcmp(argv[i], "--language")) {
|
||||||
if ((i + 1) >= argc) {
|
if ((i + 1) >= argc) {
|
||||||
fprintf(stderr, "Error: --language lacks its argument.\n");
|
fprintf(stderr, "Error: --language lacks its argument.\n");
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file
|
\file
|
||||||
\version \$Id: p_textsubs.cpp,v 1.20 2003/05/25 15:35:39 mosu Exp $
|
\version \$Id: p_textsubs.cpp,v 1.21 2003/05/29 18:50:03 mosu Exp $
|
||||||
\brief Subripper subtitle reader
|
\brief Subripper subtitle reader
|
||||||
\author Moritz Bunkus <moritz@bunkus.org>
|
\author Moritz Bunkus <moritz@bunkus.org>
|
||||||
*/
|
*/
|
||||||
@ -43,10 +43,7 @@ textsubs_packetizer_c::~textsubs_packetizer_c() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void textsubs_packetizer_c::set_headers() {
|
void textsubs_packetizer_c::set_headers() {
|
||||||
if (ti->no_utf8_subs)
|
set_codec_id(MKV_S_TEXTUTF8);
|
||||||
set_codec_id(MKV_S_TEXTASCII);
|
|
||||||
else
|
|
||||||
set_codec_id(MKV_S_TEXTUTF8);
|
|
||||||
|
|
||||||
generic_packetizer_c::set_headers();
|
generic_packetizer_c::set_headers();
|
||||||
|
|
||||||
@ -56,7 +53,7 @@ void textsubs_packetizer_c::set_headers() {
|
|||||||
int textsubs_packetizer_c::process(unsigned char *_subs, int, int64_t start,
|
int textsubs_packetizer_c::process(unsigned char *_subs, int, int64_t start,
|
||||||
int64_t length, int64_t, int64_t) {
|
int64_t length, int64_t, int64_t) {
|
||||||
int num_newlines;
|
int num_newlines;
|
||||||
char *subs, *idx1, *idx2;
|
char *subs, *idx1, *idx2, *utf8_subs;
|
||||||
int64_t end;
|
int64_t end;
|
||||||
|
|
||||||
end = start + length;
|
end = start + length;
|
||||||
@ -112,13 +109,10 @@ int textsubs_packetizer_c::process(unsigned char *_subs, int, int64_t start,
|
|||||||
}
|
}
|
||||||
*idx2 = 0;
|
*idx2 = 0;
|
||||||
|
|
||||||
if (!ti->no_utf8_subs) {
|
utf8_subs = to_utf8(cc_utf8, subs);
|
||||||
char *utf8_subs = to_utf8(cc_utf8, subs);
|
add_packet((unsigned char *)utf8_subs, strlen(utf8_subs), start, length,
|
||||||
add_packet((unsigned char *)utf8_subs, strlen(utf8_subs), start, length,
|
1, -1, -1);
|
||||||
1, -1, -1);
|
safefree(utf8_subs);
|
||||||
safefree(utf8_subs);
|
|
||||||
} else
|
|
||||||
add_packet((unsigned char *)subs, strlen(subs), start, length, 1, -1, -1);
|
|
||||||
|
|
||||||
safefree(subs);
|
safefree(subs);
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file
|
\file
|
||||||
\version \$Id: pr_generic.h,v 1.44 2003/05/25 15:35:39 mosu Exp $
|
\version \$Id: pr_generic.h,v 1.45 2003/05/29 18:50:03 mosu Exp $
|
||||||
\brief class definition for the generic reader and packetizer
|
\brief class definition for the generic reader and packetizer
|
||||||
\author Moritz Bunkus <moritz@bunkus.org>
|
\author Moritz Bunkus <moritz@bunkus.org>
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,6 @@ typedef struct {
|
|||||||
// Options used by the packetizers.
|
// Options used by the packetizers.
|
||||||
unsigned char *private_data;
|
unsigned char *private_data;
|
||||||
int private_size;
|
int private_size;
|
||||||
int no_utf8_subs;
|
|
||||||
|
|
||||||
char fourcc[5];
|
char fourcc[5];
|
||||||
float aspect_ratio;
|
float aspect_ratio;
|
||||||
|
Loading…
Reference in New Issue
Block a user