[matroska] r968 - trunk/DvdMenuXtractor
[email protected] Sun, 12 Dec 2004 18:29:41 +0300 (MSK)
Newsgroups
gmane.comp.multimedia.matroska.cvs
Message-ID
<[email protected] >
Author: robux4
Date: 2004-12-12 18:29:40 +0300 (Sun, 12 Dec 2004)
New Revision: 968
Modified:
trunk/DvdMenuXtractor/VobParser.cpp
trunk/DvdMenuXtractor/VobParser.h
Log:
fix subtitle timecode files (.idx)
Modified: trunk/DvdMenuXtractor/VobParser.cpp
===================================================================
--- trunk/DvdMenuXtractor/VobParser.cpp 2004-12-12 14:44:10 UTC (rev 967)
+++ trunk/DvdMenuXtractor/VobParser.cpp 2004-12-12 15:29:40 UTC (rev 968)
@@ -692,7 +692,7 @@
DebugLog("Subtitles streamID = 0x%X\n", substreamID);
// .sub files the VobSub way (includes the whole packet)
- m_demuxer.ProcessStream(substreamID, m_buff, DVD_VIDEO_LB_LEN, pktinfo.pts/90, pktinfo.dts/90, wxString::Format("DTS %d PTS %d - %d %d\n", m_startdts/90, m_startpts/90, pktinfo.dts/90, pktinfo.pts/90));
+ m_demuxer.ProcessStream(substreamID, m_buff, DVD_VIDEO_LB_LEN, t3, t4, wxString::Format("DTS %d PTS %d - %d %d\n", m_startdts/90, m_startpts/90, pktinfo.dts/90, pktinfo.pts/90));
}
else if(substreamID >= SUBSTREAM_AC3_LOW && substreamID < SUBSTREAM_AC3_HIGH)
{
@@ -831,16 +831,14 @@
"# alt: ", 1, 112, m_TimecodeFile);
fprintf(m_TimecodeFile, "%s\n\n", DecodeLanguage(m_language));
}
- int32_t delay = start_time - end_time;
- bool sign = delay < 0;
- delay = sign?-delay:delay;
+ int32_t delay = start_time + m_start_timecode;
int millisecond = delay % 1000;
delay /= 1000;
int second = delay % 60;
delay /= 60;
int minute = delay % 60;
delay /= 60;
- fprintf(m_TimecodeFile, "timestamp: %s%02d:%02d:%02d:%03d, filepos: %09x\n", sign?"-":"", delay,minute,second,millisecond,filepos);
+ fprintf(m_TimecodeFile, "timestamp: %02d:%02d:%02d:%03d, filepos: %09x\n", delay,minute,second,millisecond,filepos);
}
void BtnDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end_time, uint64_t filepos, wxString & debug)
@@ -1009,6 +1007,9 @@
void SubDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t duration, uint16_t vob_id, uint16_t cell_id)
{
+ if (start_timecode == 0)
+ m_start_timecode = m_end_timecode;
+ m_end_timecode += duration;
}
void BtnDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t duration, uint16_t vob_id, uint16_t cell_id)
Modified: trunk/DvdMenuXtractor/VobParser.h
===================================================================
--- trunk/DvdMenuXtractor/VobParser.h 2004-12-12 14:44:10 UTC (rev 967)
+++ trunk/DvdMenuXtractor/VobParser.h 2004-12-12 15:29:40 UTC (rev 968)
@@ -378,6 +378,8 @@
,m_forced(forced)
,m_palette(palette)
,m_language(language)
+ ,m_start_timecode(0)
+ ,m_end_timecode(0)
{}
void ProcessStream(uint8_t* buff, uint32_t size, uint32_t start_time, uint32_t end_time, wxString & debug)
{
@@ -392,6 +394,8 @@
bool m_forced;
const uint32_t * m_palette;
uint16_t m_language;
+ uint32_t m_start_timecode;
+ uint32_t m_end_timecode;
};
// ----------------------------------------------------------------------------