Fixed bug #122 (crash on SRT export.)

Fixed bug where file save dialog opened from Export window wasn't made modal.
Fixed probably-won't-ever-matter possible loss of precision in VFR calculations.

Originally committed to SVN as r424.
This commit is contained in:
Niels Martin Hansen 2006-06-21 21:58:23 +00:00
parent 9ce7873f41
commit c456f9dab8
3 changed files with 5 additions and 4 deletions

View file

@ -182,7 +182,7 @@ END_EVENT_TABLE()
// Process start
void DialogExport::OnProcess(wxCommandEvent &event) {
// Get destination
wxString filename = wxFileSelector(_("Export subtitles file"),_T(""),_T(""),_T(""),_T("All Supported Types (*.ass,*.ssa,*.srt,*.prs)|*.ass;*.ssa;*.srt;*.prs|Advanced Substation Alpha (*.ass)|*.ass|Substation Alpha (*.ssa)|*.ssa|SubRip (*.srt)|*.srt|Pre-Rendered Subtitles (*.prs)|*.prs"),wxSAVE | wxOVERWRITE_PROMPT);
wxString filename = wxFileSelector(_("Export subtitles file"),_T(""),_T(""),_T(""),_T("All Supported Types (*.ass,*.ssa,*.srt,*.prs)|*.ass;*.ssa;*.srt;*.prs|Advanced Substation Alpha (*.ass)|*.ass|Substation Alpha (*.ssa)|*.ssa|SubRip (*.srt)|*.srt|Pre-Rendered Subtitles (*.prs)|*.prs"),wxSAVE | wxOVERWRITE_PROMPT,this);
if (filename.empty()) return;
// Add filters

View file

@ -200,12 +200,13 @@ void SRTSubtitleFormat::DialogueToSRT(AssDialogue *current,std::list<AssEntry*>:
// Converts whole file to SRT
void SRTSubtitleFormat::ConvertToSRT () {
using std::list;
list<AssEntry*>::iterator next;
list<AssEntry*>::iterator prev = Line->end();
// Sort lines
Line->sort(LessByPointedToValue<AssEntry>());
list<AssEntry*>::iterator next;
list<AssEntry*>::iterator prev = Line->end();
// Process lines
bool notfirst = false;
for (list<AssEntry*>::iterator cur=Line->begin();cur!=Line->end();cur=next) {

View file

@ -278,7 +278,7 @@ int FrameRate::PFrameAtTime(int ms,bool useceil) {
// Get for constant frame rate
if (FrameRateType == CFR) {
double value = double(ms)/1000.0 * AverageFrameRate;
double value = double(ms) * AverageFrameRate / 1000.0;
if (useceil) return ceil(value);
else return floor(value);
}