mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
Also convert the TITLE comment.
This commit is contained in:
parent
55d2d3d92d
commit
392e15c261
@ -1,7 +1,7 @@
|
||||
2004-02-08 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* mkvmerge: new feature: The language tags and comments are being
|
||||
kept when reading OGM files.
|
||||
* mkvmerge: new feature: The LANGUAGE, TITLE tags and chapters are
|
||||
being kept when reading OGM files.
|
||||
|
||||
* mkvmerge: Changed the meaning of '--global-tags'. They now apply
|
||||
to the complete file.
|
||||
|
@ -441,7 +441,8 @@ ogm_reader_c::create_packetizer(int64_t tid) {
|
||||
ti->private_data = NULL;
|
||||
ti->private_size = 0;
|
||||
ti->id = dmx->serial; // ID for this track.
|
||||
ti->language = safestrdup(dmx->language);
|
||||
ti->language = dmx->language; // safestrdup(dmx->language);
|
||||
ti->track_name = dmx->title; // safestrdup(dmx->title);
|
||||
|
||||
switch (dmx->stype) {
|
||||
case OGM_STREAM_TYPE_VIDEO:
|
||||
@ -661,6 +662,7 @@ ogm_reader_c::create_packetizer(int64_t tid) {
|
||||
|
||||
}
|
||||
ti->language = NULL;
|
||||
ti->track_name = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1236,6 +1238,13 @@ ogm_reader_c::handle_stream_comments() {
|
||||
dmx->language = safestrdup(iso639_2);
|
||||
}
|
||||
|
||||
} else if (comment[0] == "TITLE") {
|
||||
if (!segment_title_set && (segment_title.length() == 0) &&
|
||||
(dmx->stype == OGM_STREAM_TYPE_VIDEO))
|
||||
segment_title = comment[1];
|
||||
safefree(dmx->title);
|
||||
dmx->title = safestrdup(comment[1].c_str());
|
||||
|
||||
} else if (starts_with(comment[0], "CHAPTER"))
|
||||
chapters.push_back(comments[j]);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ struct ogm_demuxer_t {
|
||||
int sid, stype, serial, eos;
|
||||
int units_processed, vorbis_rate;
|
||||
bool headers_read;
|
||||
char *language;
|
||||
char *language, *title;
|
||||
vector<unsigned char *> packet_data, nh_packet_data;
|
||||
vector<int> packet_sizes, nh_packet_sizes;
|
||||
#if defined(HAVE_FLAC_FORMAT_H)
|
||||
@ -85,7 +85,7 @@ struct ogm_demuxer_t {
|
||||
|
||||
ogm_demuxer_t():
|
||||
packetizer(NULL), sid(0), stype(0), serial(0), eos(0), units_processed(0),
|
||||
vorbis_rate(0), headers_read(false), language(NULL) {
|
||||
vorbis_rate(0), headers_read(false), language(NULL), title(NULL) {
|
||||
memset(&os, 0, sizeof(ogg_stream_state));
|
||||
}
|
||||
~ogm_demuxer_t() {
|
||||
@ -93,6 +93,7 @@ struct ogm_demuxer_t {
|
||||
for (i = 0; i < packet_data.size(); i++)
|
||||
safefree(packet_data[i]);
|
||||
safefree(language);
|
||||
safefree(title);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user