diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-10 19:43:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-10 19:43:01 +0100 |
| commit | 9bdd8cc51942a13e360dde4efc04b3ca417c8b94 (patch) | |
| tree | 502e33212c51fa5e269cbdec87a29ed8fa711243 | |
| parent | 5c620f37c8979a645a2094aa36b9af3d4f4ef5ec (diff) | |
| parent | 01bb4ca21bea60137dce7201d9a37a0cf5691812 (diff) | |
Merge master.
| -rw-r--r-- | ChangeLog | 19 | ||||
| -rwxr-xr-x | builds/all | 24 | ||||
| -rwxr-xr-x | builds/all-deb | 6 | ||||
| -rwxr-xr-x | builds/chroot-deb | 34 | ||||
| -rwxr-xr-x | builds/deb | 33 | ||||
| -rwxr-xr-x | builds/windows-32 | 40 | ||||
| -rwxr-xr-x | builds/windows-64 | 41 | ||||
| -rw-r--r-- | debian/changelog | 18 | ||||
| -rwxr-xr-x | pre | 29 | ||||
| -rwxr-xr-x | release | 56 | ||||
| -rw-r--r-- | src/lib/format.cc | 11 | ||||
| -rw-r--r-- | src/tools/dvdomatic.cc | 2 | ||||
| -rw-r--r-- | src/tools/po/es_ES.po | 2 | ||||
| -rw-r--r-- | src/tools/po/fr_FR.po | 2 | ||||
| -rw-r--r-- | src/tools/po/it_IT.po | 4 | ||||
| -rw-r--r-- | src/tools/po/sv_SE.po | 4 | ||||
| -rw-r--r-- | src/wx/film_editor.cc | 31 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 13 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 3 | ||||
| -rw-r--r-- | test/test.cc | 26 | ||||
| -rw-r--r-- | wscript | 2 |
21 files changed, 107 insertions, 293 deletions
@@ -1,3 +1,22 @@ +2013-04-10 Carl Hetherington <cth@carlh.net> + + * Version 0.83 released. + +2013-04-10 Carl Hetherington <cth@carlh.net> + + * Fix incorrect scaling using flat-no-stretch and scope-no-stretch + when the source is cropped (part of #113). + + * Fix incorrect display of padded films (rest of #113). + +2013-04-09 Carl Hetherington <cth@carlh.net> + + * Version 0.82 released. + +2013-04-09 Carl Hetherington <cth@carlh.net> + + * Version 0.82beta1 released. + 2013-04-09 Carl Hetherington <cth@carlh.net> * Version 0.81 released. diff --git a/builds/all b/builds/all deleted file mode 100755 index f5d64b7ff..000000000 --- a/builds/all +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -e - -OUT=/home/carl/public_html/carlh.net/software/dvdomatic - -./waf dist - -mkdir -p $OUT -mkdir -p $OUT/12.04-32 -mkdir -p $OUT/12.04-64 -mkdir -p $OUT/12.10-32 -mkdir -p $OUT/12.10-64 - -builds/all-deb -cp build/deb/12.04-32/*.deb $OUT/12.04-32/ -cp build/deb/12.04-64/*.deb $OUT/12.04-64/ -cp build/deb/12.10-32/*.deb $OUT/12.10-32/ -cp build/deb/12.10-64/*.deb $OUT/12.10-64/ - -builds/windows-32 -cp build/windows/DVD*.exe $OUT/ -builds/windows-64 -cp build/windows/DVD*.exe $OUT/ - - diff --git a/builds/all-deb b/builds/all-deb deleted file mode 100755 index 65af83e1b..000000000 --- a/builds/all-deb +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e - -builds/deb 12.04 64 -builds/deb 12.10 64 -builds/deb 12.04 32 -builds/deb 12.10 32 diff --git a/builds/chroot-deb b/builds/chroot-deb deleted file mode 100755 index 881f9f8c3..000000000 --- a/builds/chroot-deb +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -e - -UBUNTU_VERSION=$1 -BITS=$2 -if [ "$UBUNTU_VERSION" == "" -o "$BITS" == "" ]; then - echo "Syntax: $0 <ubuntu version> <bits>" - exit 1 -fi - -if [ "$BITS" == 32 ]; then - CPU=i386 -else - CPU=amd64 -fi - -cp builds/control-$UBUNTU_VERSION-$BITS debian/control -./waf dist -TARBALL=`ls -1 *.tar.bz2` -VERSION=`echo $TARBALL | sed -e 's/^dvdomatic-\(.*\).tar.bz2/\1/'` - -echo "dvdomatic_$VERSION-1_$CPU.deb video extra" > debian/files - -rm -rf build/deb -mkdir -p build/deb -cd build/deb -mv ../../*.tar.bz2 . -DEB_TARBALL="dvdomatic_$VERSION.orig.tar.bz2" -echo "Renaming $TARBALL to $DEB_TARBALL" -mv $TARBALL $DEB_TARBALL -tar xjf $DEB_TARBALL -cd dvdomatic-* -dpkg-source -b . -dpkg-buildpackage -cp ../*.deb ../../../ diff --git a/builds/deb b/builds/deb deleted file mode 100755 index 763dd55e8..000000000 --- a/builds/deb +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -UBUNTU_VERSION=$1 -BITS=$2 -if [ "$UBUNTU_VERSION" == "" -o "$BITS" == "" ]; then - echo "Syntax: $0 <ubuntu version> <bits>" - exit 1 -fi - -if [ "$BITS" == 32 ]; then - CPU=i386 -else - CPU=amd64 -fi - -ID=$UBUNTU_VERSION-$BITS -CHROOT=/home/carl/Environments/ubuntu-$ID -TARBALL=`ls -1 *.tar.bz2` -VERSION=`echo $TARBALL | sed -e 's/^dvdomatic-\(.*\).tar.bz2/\1/'` - -echo "ID: $ID" -echo "chroot: $CHROOT" -echo "tarball: $TARBALL" -echo "version: $VERSION" - -sudo cp *.tar.bz2 $CHROOT/root/ -sudo schroot -c "ubuntu-$ID" -d /root -u root -- /bin/sh -c "tar xjf dvdomatic-$VERSION.tar.bz2 && cd dvdomatic-$VERSION && builds/chroot-deb $UBUNTU_VERSION $BITS" -mkdir -p build/deb/$ID/ -echo "Copying $CHROOT/root/dvdomatic-$VERSION/build/deb/dvdomatic_$VERSION-1_$CPU.deb to build/deb/$ID" -sudo ls -lh $CHROOT/root/dvdomatic-$VERSION/build/deb/dvdomatic_$VERSION-1_$CPU.deb -sudo cp -v $CHROOT/root/dvdomatic-$VERSION/build/deb/dvdomatic_$VERSION-1_$CPU.deb build/deb/$ID/ -ls -lh build/deb/$ID - diff --git a/builds/windows-32 b/builds/windows-32 deleted file mode 100755 index d2a5f43cd..000000000 --- a/builds/windows-32 +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -export MINGW_CXX="i686-w64-mingw32-g++" -export MINGW_WINDRES="i686-w64-mingw32-windres" -export MINGW_PREFIX="/mingw/i686-w64-mingw32" -export MINGW_PATH="/mingw/bin" -export WINDOWS_PREFIX="/home/carl/Environments/windows/32" - -export PKG_CONFIG_LIBDIR=$WINDOWS_PREFIX/lib/pkgconfig - -./waf clean - -export PATH=$WINDOWS_PREFIX/bin:$MINGW_PATH:$PATH - -echo -n "USING COMPILER " -which i686-w64-mingw32-g++ - -CXX=$MINGW_CXX WINRC=$MINGW_WINDRES \ - CXXFLAGS="-I$WINDOWS_PREFIX/include -I$MINGW_PREFIX/include" \ - LINKFLAGS="-L$WINDOWS_PREFIX/lib -L$MINGW_PREFIX/lib" \ - ./waf configure --target-windows $* -if [ "$?" != "0" ]; then - exit 1 -fi - -./waf -if [ "$?" != "0" ]; then - exit 1 -fi - -d=`pwd` - -cp build/windows/installer.32.nsi build/windows/installer2.32.nsi - -sed -i "s~%resources%~$d/windows~g" build/windows/installer2.32.nsi -sed -i "s~%deps%~$WINDOWS_PREFIX~g" build/windows/installer2.32.nsi -sed -i "s~%binaries%~$d/build~g" build/windows/installer2.32.nsi -sed -i "s~%bits%~32~g" build/windows/installer2.32.nsi - -makensis build/windows/installer2.32.nsi diff --git a/builds/windows-64 b/builds/windows-64 deleted file mode 100755 index 87206937e..000000000 --- a/builds/windows-64 +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -export MINGW_CXX="x86_64-w64-mingw32-g++" -export MINGW_WINDRES="x86_64-w64-mingw32-windres" -export MINGW_PREFIX="/mingw/x86_64-w64-mingw32" -export MINGW_PATH="/mingw/bin" -export WINDOWS_PREFIX="/home/carl/Environments/windows/64" - -export PKG_CONFIG_LIBDIR=$WINDOWS_PREFIX/lib/pkgconfig - -./waf clean - -export PATH=$WINDOWS_PREFIX/bin:$MINGW_PATH:$PATH - -echo -n "USING COMPILER " -which x86_64-w64-mingw32-g++ - -CXX=$MINGW_CXX WINRC=$MINGW_WINDRES \ - CXXFLAGS="-I$WINDOWS_PREFIX/include -I$MINGW_PREFIX/include" \ - LINKFLAGS="-L$WINDOWS_PREFIX/lib -L$MINGW_PREFIX/lib" \ - PATH=$WINDOWS_PREFIX/bin:$PATH \ - ./waf configure --target-windows $* -if [ "$?" != "0" ]; then - exit 1 -fi - -./waf -if [ "$?" != "0" ]; then - exit 1 -fi - -d=`pwd` - -cp build/windows/installer.64.nsi build/windows/installer2.64.nsi - -sed -i "s~%resources%~$d/windows~g" build/windows/installer2.64.nsi -sed -i "s~%deps%~$WINDOWS_PREFIX~g" build/windows/installer2.64.nsi -sed -i "s~%binaries%~$d/build~g" build/windows/installer2.64.nsi -sed -i "s~%bits%~64~g" build/windows/installer2.64.nsi - -makensis build/windows/installer2.64.nsi diff --git a/debian/changelog b/debian/changelog index 06bc76ce8..d1cea437d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +dvdomatic (0.83-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Carl Hetherington <carl@houllier.lan> Wed, 10 Apr 2013 12:48:25 +0100 + +dvdomatic (0.82-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Carl Hetherington <carl@houllier.lan> Tue, 09 Apr 2013 23:43:35 +0100 + +dvdomatic (0.82beta1-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Carl Hetherington <carl@houllier.lan> Tue, 09 Apr 2013 21:48:56 +0100 + dvdomatic (0.81-1) UNRELEASED; urgency=low * New upstream release. @@ -1,29 +0,0 @@ -#!/usr/bin/python - -import os -import shutil - -def command(c): - os.system(c) - print c - -def current_version(): - f = open('wscript', 'rw') - while 1: - l = f.readline() - if l == '': - break - - s = l.split() - if len(s) == 3 and s[0] == "VERSION": - return s[2][1:-1] - - assert(false) - -v = current_version() - -command("./builds/windows-32") -shutil.copy(os.path.join('build', 'windows', 'DVD-o-matic %s 32-bit Installer.exe' % v), '.') -command("./builds/windows-64") -shutil.copy(os.path.join('build', 'windows', 'DVD-o-matic %s 64-bit Installer.exe' % v), '.') -command("./waf dist") diff --git a/release b/release deleted file mode 100755 index e9a29ff00..000000000 --- a/release +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/python - -import os -import sys -import datetime -import shutil -import version -import argparse - -parser = argparse.ArgumentParser(description = "Build and tag a release.") -parser.add_argument('-f', '--full', dest='full', action='store_const', const=True, help="full release", default=False) -parser.add_argument('-b', '--beta', dest='beta', action='store_const', const=True, help="beta release", default=False) -parser.add_argument('-d', '--debug', dest='debug', action='store_const', const=True, help="show commands but don't do anything", default=False) -args = parser.parse_args() - -if not args.full and not args.beta: - print "%s: must specify --full or --beta" % sys.argv[0] - sys.exit(1) - -def command(c): - if not args.debug: - os.system(c) - print c - -def check_diff_with_user(): - print "Planning to commit... ok? [y/n]" - command("git diff") - if (raw_input() != "y"): - command("git reset --hard") - print 'Aborted' - sys.exit(1) - -if not args.debug and os.popen('git status -s').read() != '': - print '%s: uncommitted changes exist.' % sys.argv[0] - sys.exit(1) - -m = version.Version.to_release -if args.beta: - m = version.Version.bump_beta - -new_version = version.rewrite_wscript(m) -version.append_to_changelog(new_version) -command("dch -b -v %s-1 \"New upstream release.\"" % new_version) - -command("./waf clean") -command("./waf dist") - -check_diff_with_user() - -command("git commit -a -m \"Bump version\"") -command("git tag -m \"v%s\" v%s" % (new_version, new_version)) - -if args.full: - version.rewrite_wscript(version.Version.bump_and_to_pre) - check_diff_with_user() - command("git commit -a -m \"Bump version\"") diff --git a/src/lib/format.cc b/src/lib/format.cc index 5eda9eb88..cce8762bd 100644 --- a/src/lib/format.cc +++ b/src/lib/format.cc @@ -200,14 +200,14 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d int Format::dcp_padding (shared_ptr<const Film> f) const { - int pad = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0); + int p = rint ((_dcp_size.width - (_dcp_size.height * ratio(f))) / 2.0); /* This comes out -ve for Scope; bodge it */ - if (pad < 0) { - pad = 0; + if (p < 0) { + p = 0; } - return pad; + return p; } float @@ -231,7 +231,8 @@ VariableFormat::ratio_as_integer (shared_ptr<const Film> f) const float VariableFormat::ratio_as_float (shared_ptr<const Film> f) const { - return float (f->video_size().width) / f->video_size().height; + libdcp::Size const c = f->cropped_size (f->video_size ()); + return float (c.width) / c.height; } /** @return A name to be presented to the user */ diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 239b4a517..3fc19a91c 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -72,7 +72,7 @@ public: { _dialog = new wxMessageDialog ( 0, - std_to_wx (String::compose (wx_to_std (_("Save changes to film \"%1\" before closing?")), film->name())), + wxString::Format (_("Save changes to film \"%s\" before closing?"), std_to_wx (film->name ()).data()), _("Film changed"), wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION ); diff --git a/src/tools/po/es_ES.po b/src/tools/po/es_ES.po index 1ab1a8489..abfbfef6d 100644 --- a/src/tools/po/es_ES.po +++ b/src/tools/po/es_ES.po @@ -109,7 +109,7 @@ msgid "S&how DCP" msgstr "&Mostrar DCP" #: src/tools/dvdomatic.cc:74 -msgid "Save changes to film \"%1\" before closing?" +msgid "Save changes to film \"%s\" before closing?" msgstr "" #: src/tools/dvdomatic.cc:319 diff --git a/src/tools/po/fr_FR.po b/src/tools/po/fr_FR.po index 35e686f67..b40c86877 100644 --- a/src/tools/po/fr_FR.po +++ b/src/tools/po/fr_FR.po @@ -106,7 +106,7 @@ msgid "S&how DCP" msgstr "Voir le DCP" #: src/tools/dvdomatic.cc:74 -msgid "Save changes to film \"%1\" before closing?" +msgid "Save changes to film \"%s\" before closing?" msgstr "" #: src/tools/dvdomatic.cc:319 diff --git a/src/tools/po/it_IT.po b/src/tools/po/it_IT.po index 09e3f5f34..38cbec157 100644 --- a/src/tools/po/it_IT.po +++ b/src/tools/po/it_IT.po @@ -106,8 +106,8 @@ msgid "S&how DCP" msgstr "&Mostra DCP" #: src/tools/dvdomatic.cc:74 -msgid "Save changes to film \"%1\" before closing?" -msgstr "Salvare i cambiamenti del film \"%1\" prima di chiudere?" +msgid "Save changes to film \"%s\" before closing?" +msgstr "Salvare i cambiamenti del film \"%s\" prima di chiudere?" #: src/tools/dvdomatic.cc:319 msgid "Select film to open" diff --git a/src/tools/po/sv_SE.po b/src/tools/po/sv_SE.po index 28566d876..57254770c 100644 --- a/src/tools/po/sv_SE.po +++ b/src/tools/po/sv_SE.po @@ -107,8 +107,8 @@ msgid "S&how DCP" msgstr "&Visa DCP" #: src/tools/dvdomatic.cc:74 -msgid "Save changes to film \"%1\" before closing?" -msgstr "Spara ändringarna till filmen \"%1\" före avslut?" +msgid "Save changes to film \"%s\" before closing?" +msgstr "Spara ändringarna till filmen \"%s\" före avslut?" #: src/tools/dvdomatic.cc:319 msgid "Select film to open" diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 9cd10ad61..c03a13bfe 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -146,7 +146,7 @@ FilmEditor::make_film_panel () } ++r; - _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n \n "), wxDefaultPosition, wxDefaultSize); + _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize); grid->Add (_frame_rate_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6); wxFont font = _frame_rate_description->GetFont(); font.SetStyle(wxFONTSTYLE_ITALIC); @@ -785,8 +785,11 @@ void FilmEditor::setup_frame_rate_description () { wxString d; + int lines = 0; + if (_film->video_frame_rate()) { d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description); + ++lines; #ifdef HAVE_SWRESAMPLE if (_film->audio_frame_rate() && _film->audio_frame_rate() != _film->target_audio_sample_rate ()) { d << wxString::Format ( @@ -794,14 +797,15 @@ FilmEditor::setup_frame_rate_description () _film->audio_frame_rate(), _film->target_audio_sample_rate() ); - } else { - d << wxT ("\n"); + ++lines; } -#else - d << wxT ("\n"); #endif } + for (int i = lines; i < 2; ++i) { + d << wxT ("\n "); + } + _frame_rate_description->SetLabel (d); } @@ -1402,13 +1406,14 @@ FilmEditor::setup_scaling_description () int lines = 0; - d << wxString::Format ( - _("Original video is %dx%d (%.2f:1)\n"), - _film->video_size().width, _film->video_size().height, - float (_film->video_size().width) / _film->video_size().height - ); - - ++lines; + if (_film->video_size().width && _film->video_size().height) { + d << wxString::Format ( + _("Original video is %dx%d (%.2f:1)\n"), + _film->video_size().width, _film->video_size().height, + float (_film->video_size().width) / _film->video_size().height + ); + ++lines; + } Crop const crop = _film->crop (); if (crop.left || crop.right || crop.top || crop.bottom) { @@ -1444,7 +1449,7 @@ FilmEditor::setup_scaling_description () } for (int i = lines; i < 4; ++i) { - d << wxT (" \n"); + d << wxT ("\n "); } _scaling_description->SetLabel (d); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index d18083694..cba19c07c 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -133,6 +133,11 @@ FilmViewer::set_film (shared_ptr<Film> f) _film = f; + _raw_frame.reset (); + _display_frame.reset (); + _panel->Refresh (); + _panel->Update (); + if (!_film) { return; } @@ -216,20 +221,20 @@ FilmViewer::paint_panel (wxPaintEvent &) dc.DrawBitmap (sub_bitmap, _display_sub_position.x, _display_sub_position.y); } - if (_film_size.width < _panel_size.width) { + if (_out_size.width < _panel_size.width) { wxPen p (GetBackgroundColour ()); wxBrush b (GetBackgroundColour ()); dc.SetPen (p); dc.SetBrush (b); - dc.DrawRectangle (_film_size.width, 0, _panel_size.width - _film_size.width, _panel_size.height); + dc.DrawRectangle (_out_size.width, 0, _panel_size.width - _out_size.width, _panel_size.height); } - if (_film_size.height < _panel_size.height) { + if (_out_size.height < _panel_size.height) { wxPen p (GetBackgroundColour ()); wxBrush b (GetBackgroundColour ()); dc.SetPen (p); dc.SetBrush (b); - dc.DrawRectangle (0, _film_size.height, _panel_size.width, _panel_size.height - _film_size.height); + dc.DrawRectangle (0, _out_size.height, _panel_size.width, _panel_size.height - _out_size.height); } } diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 0ce8a526e..c81c65acd 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -88,6 +88,9 @@ private: boost::shared_ptr<Image> _raw_frame; boost::shared_ptr<Subtitle> _raw_sub; boost::shared_ptr<Image> _display_frame; + /* The x offset at which we display the actual film content; this corresponds + to the film's padding converted to our coordinates. + */ int _display_frame_x; boost::shared_ptr<RGBPlusAlphaImage> _display_sub; Position _display_sub_position; diff --git a/test/test.cc b/test/test.cc index 592bad836..4d25d50f8 100644 --- a/test/test.cc +++ b/test/test.cc @@ -197,6 +197,32 @@ BOOST_AUTO_TEST_CASE (format_test) // BOOST_CHECK_EQUAL (f->ratio_as_integer(shared_ptr<const Film> ()), 239); } +/* Test VariableFormat-based scaling of content */ +BOOST_AUTO_TEST_CASE (scaling_test) +{ + shared_ptr<Film> film (new Film (test_film_dir ("scaling_test").string(), false)); + + /* 4:3 ratio */ + film->set_size (libdcp::Size (320, 240)); + + /* This format should preserve aspect ratio of the source */ + Format const * format = Format::from_id ("var-185"); + + /* We should have enough padding that the result is 4:3, + which would be 1440 pixels. + */ + BOOST_CHECK_EQUAL (format->dcp_padding (film), (1998 - 1440) / 2); + + /* This crops it to 1.291666667 */ + film->set_left_crop (5); + film->set_right_crop (5); + + /* We should now have enough padding that the result is 1.29166667, + which would be 1395 pixels. + */ + BOOST_CHECK_EQUAL (format->dcp_padding (film), rint ((1998 - 1395) / 2.0)); +} + BOOST_AUTO_TEST_CASE (util_test) { string t = "Hello this is a string \"with quotes\" and indeed without them"; @@ -3,7 +3,7 @@ import os import sys APPNAME = 'dvdomatic' -VERSION = '0.82pre' +VERSION = '0.84pre' def options(opt): opt.load('compiler_cxx') |
