X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=generate_dvd.cpp;h=e28659e1be467c225738b9044aa7c21b326eee8a;hp=45e9ca6d8a3f2d35583c88b763f26785baf3a6d1;hb=e7bd58c7c89565fffb38631a130e275fb58a8459;hpb=fdb477d14a28e89299a66328bd0f4f723098c508 diff --git a/generate_dvd.cpp b/generate_dvd.cpp index 45e9ca6..e28659e 100644 --- a/generate_dvd.cpp +++ b/generate_dvd.cpp @@ -1,4 +1,4 @@ -// Copyright 2005-6 Ben Hutchings . +// Copyright 2005-8 Ben Hutchings . // See the file "COPYING" for licence details. #include @@ -10,6 +10,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -211,11 +215,15 @@ void dvd_generator::generate_menu_vob(unsigned index, } } } + // Pad vertically to even y coordinates since dvdauthor claims + // odd values may result in incorrect display. + // XXX This may cause overlappping where it wasn't previously + // a problem. spumux_file << " " << temp_file_name(temp_dir_, "menu-%3d.mpeg", 1 + index); + << " | spumux -v0 -mdvd " << spumux_name << " > " << output_name; std::string command(command_stream.str()); const char * argv[] = { "/bin/sh", "-c", command.c_str(), 0 @@ -291,7 +282,9 @@ void dvd_generator::generate_menu_vob(unsigned index, sigc::slot(), 0, 0, &command_result); - if (command_result != 0) + struct stat stat_buf; + if (command_result != 0 || stat(output_name.c_str(), &stat_buf) != 0 + || stat_buf.st_size == 0) throw std::runtime_error("spumux pipeline failed"); } @@ -372,8 +365,9 @@ void dvd_generator::generate(const std::string & output_dir) const const unsigned menu_begin = titleset_num * dvdauthor_anonymous_menus_max; const unsigned menu_end = have_real_menus - ? std::min((titleset_num + 1) * dvdauthor_anonymous_menus_max, - menus_.size()) + ? std::min( + (titleset_num + 1) * dvdauthor_anonymous_menus_max, + menus_.size()) : menu_begin + 1; for (unsigned menu_index = menu_begin;