From ebe451c248c3accd1a564bcad5eabf9d32a971f3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Feb 2014 13:50:11 +0000 Subject: Updates to it_IT translation from William Fanelli. --- src/lib/po/it_IT.po | 66 +++++++++------- src/tools/po/it_IT.po | 38 ++++----- src/wx/po/it_IT.po | 215 +++++++++++++++++++++++--------------------------- 3 files changed, 154 insertions(+), 165 deletions(-) (limited to 'src') diff --git a/src/lib/po/it_IT.po b/src/lib/po/it_IT.po index a9a4a6000..584baad6e 100644 --- a/src/lib/po/it_IT.po +++ b/src/lib/po/it_IT.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-30 21:51+0000\n" -"PO-Revision-Date: 2013-04-28 10:26+0100\n" -"Last-Translator: Maci \n" +"PO-Revision-Date: 2014-02-03 10:48+0100\n" +"Last-Translator: William Fanelli \n" "Language-Team: \n" -"Language: Italiano\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.5\n" +"X-Generator: Poedit 1.6.3\n" #: src/lib/sndfile_content.cc:60 msgid "%1 [audio]" @@ -30,9 +30,8 @@ msgid "%1 channels, %2kHz, %3 samples" msgstr "" #: src/lib/ffmpeg_content.cc:237 -#, fuzzy msgid "%1 frames; %2 frames per second" -msgstr "fotogrammi al secondo" +msgstr "%1 fotogrammi; %2 fotogrammi al secondo" #: src/lib/video_content.cc:200 msgid "%1x%2 pixels (%3:1)" @@ -149,14 +148,14 @@ msgid "Content to be joined must have the same ratio." msgstr "" #: src/lib/subtitle_content.cc:74 -#, fuzzy msgid "Content to be joined must have the same subtitle X offset." -msgstr "Il DCP e il sorgente hanno la stessa frequenza." +msgstr "" +"Il contenuto da unire deve avere lo stesso spostamento X dei sottotitoli." #: src/lib/subtitle_content.cc:78 -#, fuzzy msgid "Content to be joined must have the same subtitle Y offset." -msgstr "Il DCP e il sorgente hanno la stessa frequenza." +msgstr "" +"Il contenuto da unire deve avere lo stesso spostamento Y dei sottotitoli." #: src/lib/subtitle_content.cc:82 msgid "Content to be joined must have the same subtitle scale." @@ -191,9 +190,8 @@ msgid "Could not create remote directory %1 (%2)" msgstr "Non posso creare la directory remota %1 (%2)" #: src/lib/job.cc:94 -#, fuzzy msgid "Could not open %1" -msgstr "non riesco ad aprire %1" +msgstr "Non riesco ad aprire %1" #: src/lib/scp_dcp_job.cc:176 msgid "Could not open %1 to send" @@ -230,6 +228,8 @@ msgid "" "DCP-o-matic could not open the file %1. Perhaps it does not exist or is in " "an unexpected format." msgstr "" +"DCP-o-matic non può aprire il file %1. Non esiste oppure è in un formato non " +"riconosciuto." #: src/lib/filter.cc:68 src/lib/filter.cc:69 src/lib/filter.cc:70 #: src/lib/filter.cc:71 src/lib/filter.cc:72 src/lib/filter.cc:73 @@ -253,6 +253,14 @@ msgid "" "Best regards,\n" "DCP-o-matic" msgstr "" +"Spett. Proiezionista\n" +"\n" +"troverà in allegato le KDMs per $CPL_NAME.\n" +"\n" +"Le KDM sono valide da $START_TIME fino a $END_TIME.\n" +"\n" +"Distinti saluti,\n" +"DCP-o-matic" #: src/lib/filter.cc:74 msgid "Deringing filter" @@ -264,14 +272,12 @@ msgid "Dolby CP650 and CP750" msgstr "Dolby CP750" #: src/lib/util.cc:803 -#, fuzzy msgid "Each content frame will be doubled in the DCP.\n" -msgstr "Ogni fotogramma del sorgente sarà raddoppiato nel DCP.\n" +msgstr "Ogni fotogramma del sorgente sarà duplicato nel DCP.\n" #: src/lib/util.cc:805 -#, fuzzy msgid "Each content frame will be repeated %1 more times in the DCP.\n" -msgstr "Ogni fotogramma del sorgente sarà raddoppiato nel DCP.\n" +msgstr "Ogni fotogramma del sorgente sarà ripetuto %1 volte nel DCP.\n" #: src/lib/send_kdm_email_job.cc:50 msgid "Email KDMs for %1" @@ -291,11 +297,11 @@ msgstr "Esamino il contenuto" #: src/lib/filter.cc:72 msgid "Experimental horizontal deblocking filter 1" -msgstr "Filtro di sblocco sperimentale orizzontale 1" +msgstr "Filtro deblocking orizzontale sperimentale 1" #: src/lib/filter.cc:73 msgid "Experimental vertical deblocking filter 1" -msgstr "Filtro di sblocco sperimentale verticale 1" +msgstr "Filtro deblocking verticale sperimentale 1" #: src/lib/filter.cc:79 msgid "FFMPEG deinterlacer" @@ -327,7 +333,7 @@ msgstr "Forza quantizzatore" #: src/lib/ratio.cc:43 msgid "Full frame" -msgstr "" +msgstr "Schermo intero" #: src/lib/scaler.cc:65 msgid "Gaussian" @@ -343,11 +349,11 @@ msgstr "Riduttore di rumore 3D di alta qualità" #: src/lib/filter.cc:68 msgid "Horizontal deblocking filter" -msgstr "Filtro sblocco orizzontale" +msgstr "Filtro deblocking orizzontale" #: src/lib/filter.cc:70 msgid "Horizontal deblocking filter A" -msgstr "Filtro A sblocco orizzontale" +msgstr "Filtro deblocking orizzontale A" #: src/lib/job.cc:108 src/lib/job.cc:117 msgid "" @@ -396,7 +402,7 @@ msgstr "Varie" #: src/lib/filter.cc:81 msgid "Motion compensating deinterlacer" -msgstr "Dinterlacciatore compensativo di movimento" +msgstr "Dinterlacciatore con compensazione di movimento" #: src/lib/filter.cc:84 src/lib/filter.cc:88 src/lib/filter.cc:89 #: src/lib/filter.cc:91 @@ -494,6 +500,10 @@ msgid "" "unfortunately it cannot be loaded into this version. You will need to " "create a new Film, re-add your content and set it up again. Sorry!" msgstr "" +"Questo film è stato creato con una vecchia versione di DCP-o-matic, e " +"purtroppo non può essere caricato in questa versione. Sarà necessario creare " +"un nuovo film, ri-aggiungere i tuoi contenuti e configurarlo di nuovo. Ci " +"dispiace!" #: src/lib/dcp_content_type.cc:46 msgid "Trailer" @@ -521,7 +531,7 @@ msgstr "Maschera unsharp e sfocatura Gaussiana" #: src/lib/colour_conversion.cc:145 msgid "Untitled" -msgstr "" +msgstr "Senza titolo" #: src/lib/filter.cc:69 msgid "Vertical deblocking filter" @@ -545,7 +555,7 @@ msgstr "Altro filtro di deinterlacciamento" #: src/lib/film.cc:289 msgid "You must add some content to the DCP before creating it" -msgstr "" +msgstr "Devi aggiungere dei contenuti al DCP prima di crearlo" #: src/lib/image_content.cc:68 msgid "[moving images]" @@ -569,9 +579,8 @@ msgid "connecting" msgstr "mi sto connettendo" #: src/lib/film.cc:285 -#, fuzzy msgid "container" -msgstr "contenuto" +msgstr "contenitore" #: src/lib/film.cc:293 msgid "content type" @@ -606,9 +615,8 @@ msgid "could not move audio MXF into the DCP (%1)" msgstr "" #: src/lib/sndfile_decoder.cc:45 -#, fuzzy msgid "could not open audio file for reading" -msgstr "non riesco ad aprire il file per leggerlo" +msgstr "non riesco ad aprire il file in lettura" #: src/lib/exceptions.cc:29 msgid "could not open file %1" @@ -720,7 +728,7 @@ msgstr "sRGB" #: src/lib/config.cc:82 msgid "sRGB non-linearised" -msgstr "" +msgstr "sRGB non linearizzato" #: src/lib/util.cc:160 msgid "seconds" diff --git a/src/tools/po/it_IT.po b/src/tools/po/it_IT.po index f63169721..15276515b 100644 --- a/src/tools/po/it_IT.po +++ b/src/tools/po/it_IT.po @@ -8,18 +8,18 @@ msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-30 21:51+0000\n" -"PO-Revision-Date: 2013-04-28 10:31+0100\n" -"Last-Translator: Maci \n" +"PO-Revision-Date: 2014-02-03 09:36+0100\n" +"Last-Translator: William Fanelli \n" "Language-Team: \n" -"Language: Italiano\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.5\n" +"X-Generator: Poedit 1.6.3\n" #: src/tools/dcpomatic.cc:366 msgid "%1 already exists as a file, so you cannot use it for a new film." -msgstr "" +msgstr "%1 esiste già il file, non è possibile usarlo per un nuovo film" #: src/tools/dcpomatic.cc:241 msgid "&Edit" @@ -27,7 +27,7 @@ msgstr "&Modifica" #: src/tools/dcpomatic.cc:208 msgid "&Exit" -msgstr "" +msgstr "&Esci" #: src/tools/dcpomatic.cc:239 msgid "&File" @@ -71,20 +71,19 @@ msgstr "&Invia DCP a TMS" #: src/tools/dcpomatic.cc:244 msgid "&Tools" -msgstr "" +msgstr "&Strumenti" #: src/tools/dcpomatic.cc:236 msgid "About" msgstr "Informazioni" #: src/tools/dcpomatic.cc:234 -#, fuzzy msgid "About DCP-o-matic" -msgstr "DVD-o-matic" +msgstr "Su DVD-o-matic" #: src/tools/dcpomatic.cc:230 msgid "Check for updates" -msgstr "" +msgstr "Controlla aggiornamenti" #: src/tools/dcpomatic.cc:633 msgid "Could not load film %1 (%2)" @@ -105,9 +104,8 @@ msgstr "" #: src/tools/dcpomatic.cc:337 src/tools/dcpomatic.cc:591 #: src/tools/dcpomatic.cc:644 -#, fuzzy msgid "DCP-o-matic" -msgstr "DVD-o-matic" +msgstr "DCP-o-matic" #: src/tools/dcpomatic.cc:229 msgid "Encoding servers..." @@ -119,7 +117,7 @@ msgstr "Film modificato" #: src/tools/dcpomatic.cc:228 msgid "Hints..." -msgstr "" +msgstr "Suggerimenti..." #: src/tools/dcpomatic.cc:223 msgid "Make &KDMs..." @@ -148,34 +146,38 @@ msgid "" "The DCP for this film will take up about %.1f Gb, and the disk that you are " "using only has %.1f Gb available. Do you want to continue anyway?" msgstr "" +"Il DCP di questo film occupa %.1f Gb, ma il disco che stai usando dispone di " +"%.1f Gb liberi. Vuoi continuare ugualmente?" #: src/tools/dcpomatic.cc:728 msgid "The DCP-o-matic download server could not be contacted." -msgstr "" +msgstr "Il download server di DCP-o-matic non può essere contattato." #: src/tools/dcpomatic.cc:356 msgid "" "The directory %1 already exists and is not empty. Are you sure you want to " "use it?" -msgstr "" +msgstr "La cartella %1 esiste già e non è vuota. Sei sicuro di volerla usare?" #: src/tools/dcpomatic.cc:723 msgid "There are no new versions of DCP-o-matic available." -msgstr "" +msgstr "Non ci sono nuove versioni di DCP-o-matic disponibili." #: src/tools/dcpomatic.cc:553 msgid "There are unfinished jobs; are you sure you want to quit?" -msgstr "" +msgstr "C'è un processo in corso: sei sicuro di voler uscire?" #: src/tools/dcpomatic.cc:554 msgid "Unfinished jobs" -msgstr "" +msgstr "Processo in corso" #: src/tools/dcpomatic.cc:395 msgid "" "You did not select a folder. Make sure that you select a folder before " "clicking Open." msgstr "" +"Non hai selezionato una cartella. Assicurati di selezionare una cartella " +"prima di cliccare Apri." #~ msgid "&Analyse audio" #~ msgstr "&Analizza audio" diff --git a/src/wx/po/it_IT.po b/src/wx/po/it_IT.po index 08852b886..00d1ac09a 100644 --- a/src/wx/po/it_IT.po +++ b/src/wx/po/it_IT.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-01-30 21:51+0000\n" -"PO-Revision-Date: 2013-04-28 10:27+0100\n" -"Last-Translator: Maci \n" +"PO-Revision-Date: 2014-02-03 10:46+0100\n" +"Last-Translator: William Fanelli \n" "Language-Team: \n" -"Language: Italiano\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.5\n" +"X-Generator: Poedit 1.6.3\n" #: src/wx/subtitle_panel.cc:48 src/wx/subtitle_panel.cc:57 #: src/wx/subtitle_panel.cc:66 @@ -73,32 +73,31 @@ msgstr "" #: src/wx/update_dialog.cc:34 msgid "A new version of DCP-o-matic is available." -msgstr "" +msgstr "Una nuova versione di DCP-o-matic è disponibile" #: src/wx/about_dialog.cc:30 -#, fuzzy msgid "About DCP-o-matic" -msgstr "DCP-o-matic" +msgstr "Su DCP-o-matic" #: src/wx/kdm_dialog.cc:66 msgid "Add Cinema..." -msgstr "" +msgstr "Aggiungi Cinema" #: src/wx/kdm_dialog.cc:73 msgid "Add Screen..." -msgstr "" +msgstr "Aggiungi Schermo" #: src/wx/film_editor.cc:272 msgid "Add file(s)..." -msgstr "" +msgstr "Aggiungi File" #: src/wx/film_editor.cc:274 msgid "Add folder..." -msgstr "" +msgstr "Aggiungi cartella" #: src/wx/editable_list.h:61 msgid "Add..." -msgstr "" +msgstr "Aggiungi..." #: src/wx/audio_dialog.cc:33 src/wx/audio_panel.cc:40 msgid "Audio" @@ -117,20 +116,19 @@ msgid "Audio Language (e.g. EN)" msgstr "Lingua dell'audio (es. EN)" #: src/wx/audio_panel.cc:81 -#, fuzzy msgid "Audio Stream" -msgstr "Ritardo dell'audio" +msgstr "Traccia Audio" #: src/wx/film_editor.cc:161 -#, fuzzy msgid "Audio channels" -msgstr "canali" +msgstr "Canali audio" #: src/wx/audio_mapping_view.cc:325 #, c-format msgid "" "Audio will be passed from content channel %d to DCP channel %d unaltered." msgstr "" +"L' audio sarà trasferito dal canale %d sorgente al canale %d DCP inalterato." #: src/wx/audio_mapping_view.cc:328 #, c-format @@ -138,6 +136,8 @@ msgid "" "Audio will be passed from content channel %d to DCP channel %d with gain " "%.1fdB." msgstr "" +"L' audio sarà trasferito dal canale %d sorgente al canale %d DCP con " +"guadagno di %.1fdB." #: src/wx/job_wrapper.cc:38 #, c-format @@ -169,9 +169,8 @@ msgid "Cancel" msgstr "Annulla" #: src/wx/audio_gain_dialog.cc:26 -#, fuzzy msgid "Channel gain" -msgstr "Canali" +msgstr "Guadagno audio" #: src/wx/audio_dialog.cc:44 msgid "Channels" @@ -179,62 +178,57 @@ msgstr "Canali" #: src/wx/config_dialog.cc:143 msgid "Check for testing updates as well as stable ones" -msgstr "" +msgstr "Controlla per aggiornamenti test o stabili" #: src/wx/config_dialog.cc:139 msgid "Check for updates on startup" -msgstr "" +msgstr "Controlla gli aggiornamentio alla partenza" #: src/wx/content_menu.cc:182 -#, fuzzy msgid "Choose a file" -msgstr "Crea nella cartella" +msgstr "Scegli un file" #: src/wx/film_editor.cc:767 msgid "Choose a file or files" -msgstr "" +msgstr "Scegli uno o più file" #: src/wx/content_menu.cc:175 src/wx/film_editor.cc:790 -#, fuzzy msgid "Choose a folder" -msgstr "Crea nella cartella" +msgstr "Scegli una cartella" #: src/wx/content_colour_conversion_dialog.cc:33 #: src/wx/preset_colour_conversion_dialog.cc:30 src/wx/video_panel.cc:164 msgid "Colour conversion" -msgstr "" +msgstr "Conversione colore" #: src/wx/config_dialog.cc:65 msgid "Colour conversions" -msgstr "" +msgstr "Conversioni colore" #: src/wx/film_editor.cc:132 -#, fuzzy msgid "Container" -msgstr "Contenuto" +msgstr "Contenitore" #: src/wx/film_editor.cc:85 msgid "Content" -msgstr "Contenuto" +msgstr "Sorgente" #: src/wx/film_editor.cc:137 msgid "Content Type" -msgstr "Tipo di contenuto" +msgstr "Tipo di sorgente" #: src/wx/audio_mapping_view.cc:273 -#, fuzzy msgid "Content channel" -msgstr "1 canale" +msgstr "Canale Sorgente" #: src/wx/video_panel.cc:335 #, c-format msgid "Content frame rate %.4f\n" -msgstr "" +msgstr "Freq. fotogrammi sorgente %.4f\n" #: src/wx/dci_metadata_dialog.cc:35 -#, fuzzy msgid "Content version" -msgstr "Tipo di contenuto" +msgstr "Tipo di sorgente" #: src/wx/video_panel.cc:293 #, fuzzy, c-format @@ -243,7 +237,7 @@ msgstr "Il video originale è %dx%d (%.2f:1)\n" #: src/wx/audio_dialog.cc:136 msgid "Could not analyse audio." -msgstr "" +msgstr "Non posso analizzare l'audio." #: src/wx/film_viewer.cc:332 #, c-format @@ -275,7 +269,7 @@ msgstr "" #: src/wx/dci_metadata_dialog.cc:30 msgid "DCI name" -msgstr "Nome del DCP" +msgstr "Nome DCI" #: src/wx/film_editor.cc:87 src/wx/kdm_dialog.cc:102 msgid "DCP" @@ -300,7 +294,7 @@ msgstr "Audio DCP-o-matic - %s" #: src/wx/config_dialog.cc:216 msgid "Default DCI name details" -msgstr "Dettagli del nome di default DCI" +msgstr "Dettagli del nome DCI predefinito" #: src/wx/config_dialog.cc:229 #, fuzzy @@ -308,32 +302,28 @@ msgid "Default JPEG2000 bandwidth" msgstr "Banda passante JPEG2000" #: src/wx/config_dialog.cc:238 -#, fuzzy msgid "Default audio delay" -msgstr "Tipo di contenuto" +msgstr "Ritardo audio predefinito" #: src/wx/config_dialog.cc:220 -#, fuzzy msgid "Default container" -msgstr "Tipo di contenuto" +msgstr "Contenitore predefinito" #: src/wx/config_dialog.cc:224 -#, fuzzy msgid "Default content type" -msgstr "Tipo di contenuto" +msgstr "Tipo sorgente predefinito" #: src/wx/config_dialog.cc:208 msgid "Default directory for new films" -msgstr "Directory di default per i nuovi films" +msgstr "Cartella predefinita per i nuovi films" #: src/wx/config_dialog.cc:200 -#, fuzzy msgid "Default duration of still images" -msgstr "Directory di default per i nuovi films" +msgstr "Durata predefinita immagini statiche" #: src/wx/config_dialog.cc:61 msgid "Defaults" -msgstr "" +msgstr "Predefiniti" #: src/wx/film_editor.cc:128 src/wx/job_manager_view.cc:78 msgid "Details..." @@ -348,14 +338,12 @@ msgid "Down" msgstr "" #: src/wx/kdm_dialog.cc:68 -#, fuzzy msgid "Edit Cinema..." -msgstr "Modifica..." +msgstr "Modifica Cinema..." #: src/wx/kdm_dialog.cc:75 -#, fuzzy msgid "Edit Screen..." -msgstr "Modifica..." +msgstr "Modifica Schermo..." #: src/wx/audio_mapping_view.cc:136 src/wx/config_dialog.cc:217 #: src/wx/video_panel.cc:157 src/wx/video_panel.cc:174 @@ -365,7 +353,7 @@ msgstr "Modifica..." #: src/wx/cinema_dialog.cc:35 msgid "Email address for KDM delivery" -msgstr "" +msgstr "Indirizzo email per consegna KDM" #: src/wx/servers_list_dialog.cc:30 #, fuzzy @@ -379,7 +367,7 @@ msgstr "Servers di codifica" #: src/wx/film_editor.cc:157 msgid "Encrypted" -msgstr "" +msgstr "Criptato" #: src/wx/dci_metadata_dialog.cc:59 msgid "Facility (e.g. DLA)" @@ -399,12 +387,11 @@ msgstr "Filtri" #: src/wx/content_menu.cc:52 msgid "Find missing..." -msgstr "" +msgstr "Trova mancante..." #: src/wx/film_editor.cc:143 -#, fuzzy msgid "Frame Rate" -msgstr "Frequenza fotogrammi del DCP" +msgstr "Frequenza fotogrammi" #: src/wx/properties_dialog.cc:41 msgid "Frames" @@ -420,7 +407,7 @@ msgstr "" #: src/wx/kdm_dialog.cc:85 msgid "From" -msgstr "" +msgstr "Da" #: src/wx/config_dialog.cc:135 msgid "From address for KDM emails" @@ -441,7 +428,7 @@ msgstr "Calcolatore del guadagno audio" #: src/wx/audio_gain_dialog.cc:31 #, c-format msgid "Gain for content channel %d in DCP channel %d" -msgstr "" +msgstr "Guadagno per il canale sorgente %d nel canale DCP %d" #: src/wx/properties_dialog.cc:57 msgid "Gb" @@ -449,7 +436,7 @@ msgstr "Gb" #: src/wx/hints_dialog.cc:26 msgid "Hints" -msgstr "" +msgstr "Suggerimenti" #: src/wx/servers_list_dialog.cc:40 msgid "Host" @@ -502,7 +489,7 @@ msgstr "" #: src/wx/film_editor.cc:290 msgid "Keep video in sequence" -msgstr "" +msgstr "Tieni i video in sequenza" #: src/wx/audio_mapping_view.cc:276 msgid "L" @@ -518,7 +505,7 @@ msgstr "" #: src/wx/colour_conversion_editor.cc:49 msgid "Linearise input gamma curve for low values" -msgstr "" +msgstr "Linearizza la curva del gamma in ingresso per piccoli valori" #: src/wx/audio_mapping_view.cc:292 #, fuzzy @@ -527,7 +514,7 @@ msgstr "s" #: src/wx/film_editor.cc:741 msgid "MISSING: " -msgstr "" +msgstr "MANCANTE:" #: src/wx/config_dialog.cc:127 #, fuzzy @@ -541,11 +528,11 @@ msgstr "Nome utente del TMS" #: src/wx/kdm_dialog.cc:47 msgid "Make KDMs" -msgstr "" +msgstr "Crea KDM" #: src/wx/colour_conversion_editor.cc:67 msgid "Matrix" -msgstr "" +msgstr "Matrice" #: src/wx/config_dialog.cc:233 src/wx/film_editor.cc:180 msgid "Mbit/s" @@ -560,9 +547,8 @@ msgid "Miscellaneous" msgstr "" #: src/wx/video_panel.cc:281 -#, fuzzy msgid "Multiple content selected" -msgstr "Tipo di contenuto" +msgstr "Molteplici sorgenti selezionate" #: src/wx/dir_picker_ctrl.cc:51 msgid "My Documents" @@ -579,16 +565,16 @@ msgstr "Nuovo Film" #: src/wx/update_dialog.cc:36 msgid "New versions of DCP-o-matic are available." -msgstr "" +msgstr "Una nuova versione di DCP-o-matic è disponibile." #: src/wx/audio_mapping_view.cc:323 #, c-format msgid "No audio will be passed from content channel %d to DCP channel %d." -msgstr "" +msgstr "Nessun audio sarà passato dal canale %d sorgente al canale %d del DCP" #: src/wx/video_panel.cc:198 msgid "No stretch" -msgstr "" +msgstr "Nessuna distorsione" #: src/wx/video_panel.cc:155 src/wx/video_panel.cc:249 msgid "None" @@ -599,13 +585,12 @@ msgid "Off" msgstr "" #: src/wx/config_dialog.cc:119 -#, fuzzy msgid "Outgoing mail server" -msgstr "Servers di codifica" +msgstr "Mail server posta in uscita" #: src/wx/colour_conversion_editor.cc:78 msgid "Output gamma" -msgstr "" +msgstr "Gamma in uscita" #: src/wx/dci_metadata_dialog.cc:63 msgid "Package Type (e.g. OV)" @@ -623,7 +608,7 @@ msgstr "Password del TMS" #: src/wx/job_manager_view.cc:72 src/wx/job_manager_view.cc:164 msgid "Pause" -msgstr "" +msgstr "Pausa" #: src/wx/audio_dialog.cc:60 msgid "Peak" @@ -643,7 +628,7 @@ msgstr "Attendere prego; sto analizzando l'audio..." #: src/wx/timing_panel.cc:39 msgid "Position" -msgstr "" +msgstr "Posizione" #: src/wx/audio_mapping_view.cc:280 msgid "R" @@ -663,23 +648,20 @@ msgid "Remove" msgstr "Rimuovi" #: src/wx/kdm_dialog.cc:70 -#, fuzzy msgid "Remove Cinema" -msgstr "Rimuovi" +msgstr "Rimuovi Cinema" #: src/wx/kdm_dialog.cc:77 -#, fuzzy msgid "Remove Screen" -msgstr "Rimuovi" +msgstr "Rimuovi Schermo" #: src/wx/repeat_dialog.cc:33 msgid "Repeat" msgstr "" #: src/wx/repeat_dialog.cc:24 -#, fuzzy msgid "Repeat Content" -msgstr "Seleziona il file con il contenuto" +msgstr "Ripeti il contenuto" #: src/wx/content_menu.cc:50 msgid "Repeat..." @@ -687,7 +669,7 @@ msgstr "" #: src/wx/film_editor.cc:170 msgid "Resolution" -msgstr "" +msgstr "Risoluzione" #: src/wx/job_manager_view.cc:167 msgid "Resume" @@ -695,7 +677,7 @@ msgstr "" #: src/wx/audio_mapping_view.cc:331 msgid "Right click to change gain." -msgstr "" +msgstr "Clicca il tasto destro per cambiare guadagno." #: src/wx/video_panel.cc:101 msgid "Right crop" @@ -711,9 +693,8 @@ msgid "SMPTE" msgstr "" #: src/wx/video_panel.cc:134 -#, fuzzy msgid "Scale to" -msgstr "Scaler" +msgstr "Scala a" #: src/wx/video_panel.cc:320 #, c-format @@ -725,13 +706,12 @@ msgid "Scaler" msgstr "Scaler" #: src/wx/screen_dialog.cc:88 -#, fuzzy msgid "Select Certificate File" -msgstr "Seleziona il file con il contenuto" +msgstr "Seleziona il file del Certificato" #: src/wx/kdm_dialog.cc:136 msgid "Send by email" -msgstr "" +msgstr "Manda per email" #: src/wx/server_dialog.cc:28 msgid "Server" @@ -762,9 +742,8 @@ msgid "Snap" msgstr "" #: src/wx/update_dialog.cc:43 -#, fuzzy msgid "Stable version " -msgstr "Tipo di contenuto" +msgstr "Versione stabile" #: src/wx/film_editor.cc:185 msgid "Standard" @@ -783,19 +762,16 @@ msgid "Subtitle Scale" msgstr "Scala dei Sottotitoli" #: src/wx/subtitle_panel.cc:70 -#, fuzzy msgid "Subtitle Stream" -msgstr "Scala dei Sottotitoli" +msgstr "Traccia sottotitoli" #: src/wx/subtitle_panel.cc:44 -#, fuzzy msgid "Subtitle X Offset" -msgstr "Sfalsamento dei Sottotitoli" +msgstr "Spostamento X dei Sottotitoli" #: src/wx/subtitle_panel.cc:53 -#, fuzzy msgid "Subtitle Y Offset" -msgstr "Sfalsamento dei Sottotitoli" +msgstr "Spostamento Y dei Sottotitoli" #: src/wx/subtitle_panel.cc:34 msgid "Subtitles" @@ -806,9 +782,8 @@ msgid "Supported by" msgstr "" #: src/wx/config_dialog.cc:69 -#, fuzzy msgid "TMS" -msgstr "RMS" +msgstr "TMS" #: src/wx/config_dialog.cc:305 #, fuzzy @@ -820,9 +795,8 @@ msgid "Territory (e.g. UK)" msgstr "Nazione (es. UK)" #: src/wx/update_dialog.cc:48 -#, fuzzy msgid "Test version " -msgstr "Tipo di contenuto" +msgstr "Versione di test" #: src/wx/content_menu.cc:223 msgid "" @@ -830,10 +804,12 @@ msgid "" "missing. Either try again with the correct content file or remove the " "missing content." msgstr "" +"Il/i file sorgenteo che hai specificato sono diversi da quelli mancanti. " +"Riprova oppure rimuovi la sorgente mancante." #: src/wx/hints_dialog.cc:97 msgid "There are no hints: everything looks good!" -msgstr "" +msgstr "Non ci sono suggerimenti: sembra tutto a posto!" #: src/wx/servers_list_dialog.cc:48 msgid "Threads" @@ -848,9 +824,8 @@ msgid "Time" msgstr "Tempo" #: src/wx/timeline_dialog.cc:32 -#, fuzzy msgid "Timeline" -msgstr "Tempo" +msgstr "Timeline" #: src/wx/film_editor.cc:282 msgid "Timeline..." @@ -869,14 +844,12 @@ msgid "Translated by" msgstr "" #: src/wx/timing_panel.cc:48 -#, fuzzy msgid "Trim from end" -msgstr "Taglia fotogrammi" +msgstr "Taglia dalla fine" #: src/wx/timing_panel.cc:45 -#, fuzzy msgid "Trim from start" -msgstr "Taglia fotogrammi" +msgstr "Taglia dall'inizio" #: src/wx/audio_dialog.cc:55 src/wx/video_panel.cc:77 msgid "Type" @@ -884,15 +857,15 @@ msgstr "Tipo" #: src/wx/kdm_dialog.cc:91 msgid "Until" -msgstr "" +msgstr "Fino a" #: src/wx/film_editor.cc:278 msgid "Up" -msgstr "" +msgstr "Su" #: src/wx/update_dialog.cc:27 msgid "Update" -msgstr "" +msgstr "Aggiorna" #: src/wx/film_editor.cc:126 msgid "Use DCI name" @@ -900,30 +873,27 @@ msgstr "Usa nome DCI" #: src/wx/config_dialog.cc:369 msgid "Use all servers" -msgstr "" +msgstr "Usa tutti i server" #: src/wx/film_editor.cc:147 msgid "Use best" msgstr "Usa la migliore" #: src/wx/content_colour_conversion_dialog.cc:41 -#, fuzzy msgid "Use preset" -msgstr "Usa la migliore" +msgstr "Usa predefinito" #: src/wx/config_dialog.cc:309 -#, fuzzy msgid "User name" -msgstr "Usa nome DCI" +msgstr "Nome utente" #: src/wx/video_panel.cc:70 msgid "Video" msgstr "Video" #: src/wx/timing_panel.cc:56 -#, fuzzy msgid "Video frame rate" -msgstr "Frequenza fotogrammi del DCP" +msgstr "Frequenza fotogrammi video" #: src/wx/subtitle_panel.cc:39 msgid "With Subtitles" @@ -943,6 +913,8 @@ msgid "" "You have %d files that look like they are VOB files from DVD. You should " "join them to ensure smooth joins between the files." msgstr "" +"Ci sono %d file che sembrano essere DVD VOB. Dovresti unirli per assicurare " +"una giunta senza interruzioni tra i file." #: src/wx/hints_dialog.cc:76 #, c-format @@ -950,18 +922,25 @@ msgid "" "Your DCP frame rate (%d fps) may cause problems in a few (mostly older) " "projectors. Use 24 or 48 frames per second to be on the safe side." msgstr "" +"La frequenza fotogrammi scelta per questo DCP (%d fps) potrebbe creare " +"problemi in alcuni (per lo più vecchi) proiettori. Usa 24 o 48 frame al " +"secondo se vuoi esssere sicuro." #: src/wx/hints_dialog.cc:66 msgid "" "Your DCP has an odd number of audio channels. This is very likely to cause " "problems on playback." msgstr "" +"Il vostro DCP ha un numero dispari di canali audio. Questo può causare " +"problemi durante la riproduzione." #: src/wx/hints_dialog.cc:70 msgid "" "Your DCP has fewer than 6 audio channels. This may cause problems on some " "projectors." msgstr "" +"Il vostro DCP ha meno di 6 canali audio. Questo può causare problemi su " +"alcuni proiettori." #: src/wx/timeline.cc:213 #, fuzzy -- cgit v1.2.3 From d8a2e55855b50eda28ec7d394449274f5e085bd6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Feb 2014 14:52:23 +0000 Subject: Fix some coverity-reported stuff. --- ChangeLog | 2 ++ src/lib/audio_analysis.cc | 11 +++++++++ src/lib/config.h | 12 ---------- src/lib/ffmpeg.cc | 3 ++- src/lib/ffmpeg_content.h | 2 ++ src/lib/player.cc | 2 ++ src/lib/scp_dcp_job.cc | 6 +++-- src/lib/writer.cc | 4 +++- src/tools/dcpomatic_create.cc | 52 +++++++++++++++++++++++++------------------ src/tools/server_test.cc | 14 ++++++------ src/wx/audio_plot.cc | 4 +++- src/wx/timeline.cc | 2 +- test/resampler_test.cc | 2 +- 13 files changed, 68 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index d788d63cd..28e29b88d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-02-05 Carl Hetherington + * A variety of fixes to small problems found by Coverity. + * Updates to it_IT translation from William Fanelli. 2014-02-02 Carl Hetherington diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc index 1488f89fc..98d092726 100644 --- a/src/lib/audio_analysis.cc +++ b/src/lib/audio_analysis.cc @@ -93,10 +93,21 @@ AudioAnalysis::AudioAnalysis (boost::filesystem::path filename) for (int i = 0; i < channels; ++i) { int points; fscanf (f, "%d", &points); + if (feof (f)) { + fclose (f); + return; + } + for (int j = 0; j < points; ++j) { _data[i].push_back (AudioPoint (f)); + if (feof (f)) { + fclose (f); + return; + } } } + + fclose (f); } void diff --git a/src/lib/config.h b/src/lib/config.h index 791e41e8f..d77969b3e 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -193,14 +193,6 @@ public: _server_port_base = p; } - void set_reference_scaler (Scaler const * s) { - _reference_scaler = s; - } - - void set_reference_filters (std::vector const & f) { - _reference_filters = f; - } - /** @param i IP address of a TMS that we can copy DCPs to */ void set_tms_ip (std::string i) { _tms_ip = i; @@ -326,10 +318,6 @@ private: bool _use_any_servers; /** J2K encoding servers that should definitely be used */ std::vector _servers; - /** Scaler to use for the "A" part of A/B comparisons */ - Scaler const * _reference_scaler; - /** Filters to use for the "A" part of A/B comparisons */ - std::vector _reference_filters; /** The IP address of a TMS that we can copy DCPs to */ std::string _tms_ip; /** The path on a TMS that we should write DCPs to */ diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index d3653e311..b7ae04b06 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -146,7 +146,8 @@ void FFmpeg::setup_video () { boost::mutex::scoped_lock lm (_mutex); - + + assert (_video_stream >= 0); AVCodecContext* context = _format_context->streams[_video_stream]->codec; AVCodec* codec = avcodec_find_decoder (context->codec_id); diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 7ff159b85..b1f2abcea 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -86,6 +86,8 @@ private: /* Constructor for tests */ FFmpegAudioStream () : FFmpegStream ("", 0) + , frame_rate (0) + , channels (0) , mapping (1) {} }; diff --git a/src/lib/player.cc b/src/lib/player.cc index e661a7b36..42551889b 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -62,6 +62,8 @@ public: , decoder (d) , video_position (c->position ()) , audio_position (c->position ()) + , repeat_to_do (0) + , repeat_done (0) {} /** Set this piece to repeat a video frame a given number of times */ diff --git a/src/lib/scp_dcp_job.cc b/src/lib/scp_dcp_job.cc index 310303c09..22715978a 100644 --- a/src/lib/scp_dcp_job.cc +++ b/src/lib/scp_dcp_job.cc @@ -191,8 +191,10 @@ SCPDCPJob::run () } to_do -= t; bytes_transferred += t; - - set_progress ((double) bytes_transferred / bytes_to_transfer); + + if (bytes_to_transfer > 0) { + set_progress ((double) bytes_transferred / bytes_to_transfer); + } } fclose (f); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index c2a6c981b..42187dc6e 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -541,7 +541,9 @@ Writer::check_existing_picture_mxf () shared_ptr job = _job.lock (); assert (job); - job->set_progress (float (_first_nonexistant_frame) / N); + if (N > 0) { + job->set_progress (float (_first_nonexistant_frame) / N); + } if (_film->three_d ()) { if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_LEFT)) { diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 8be468b30..8dc4de50e 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include "lib/version.h" @@ -34,6 +35,7 @@ using std::string; using std::cout; using std::cerr; using std::list; +using std::exception; using boost::shared_ptr; static void @@ -98,31 +100,37 @@ main (int argc, char* argv[]) dcpomatic_setup (); ui_signaller = new UISignaller (); - shared_ptr film (new Film (output)); - if (!name.empty ()) { - film->set_name (name); - } - - for (int i = optind; i < argc; ++i) { - film->examine_and_add_content (content_factory (film, argv[i])); - } - - JobManager* jm = JobManager::instance (); - while (jm->work_to_do ()) { - ui_signaller->ui_idle (); - } - - if (jm->errors ()) { - list > jobs = jm->get (); - for (list >::iterator i = jobs.begin(); i != jobs.end(); ++i) { - if ((*i)->finished_in_error ()) { - cerr << (*i)->error_summary () << "\n" - << (*i)->error_details () << "\n"; + try { + shared_ptr film (new Film (output)); + if (!name.empty ()) { + film->set_name (name); + } + + for (int i = optind; i < argc; ++i) { + film->examine_and_add_content (content_factory (film, argv[i])); + } + + JobManager* jm = JobManager::instance (); + while (jm->work_to_do ()) { + ui_signaller->ui_idle (); + } + + if (jm->errors ()) { + list > jobs = jm->get (); + for (list >::iterator i = jobs.begin(); i != jobs.end(); ++i) { + if ((*i)->finished_in_error ()) { + cerr << (*i)->error_summary () << "\n" + << (*i)->error_details () << "\n"; + } } + exit (EXIT_FAILURE); } + + film->write_metadata (); + } catch (exception& e) { + cerr << argv[0] << ": " << e.what() << "\n"; exit (EXIT_FAILURE); } - - film->write_metadata (); + return 0; } diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index b2c5e784b..039088862 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -137,14 +137,14 @@ main (int argc, char* argv[]) dcpomatic_setup (); - server = new ServerDescription (server_host, 1); - film.reset (new Film (film_dir)); - film->read_metadata (); - - shared_ptr player = film->make_player (); - player->disable_audio (); - try { + server = new ServerDescription (server_host, 1); + film.reset (new Film (film_dir)); + film->read_metadata (); + + shared_ptr player = film->make_player (); + player->disable_audio (); + player->Video.connect (boost::bind (process_video, _1, _2, _3, _5)); bool done = false; while (!done) { diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index f78885772..fd2619255 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -259,7 +259,9 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel) const p += pow (*j, 2); } - p = sqrt (p / smoothing.size ()); + if (smoothing.size() > 0) { + p = sqrt (p / smoothing.size ()); + } path.AddLineToPoint (_db_label_width + i * _x_scale, y_for_linear (p)); } diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 6cc1f79d9..4e306c499 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -474,7 +474,7 @@ void Timeline::setup_pixels_per_time_unit () { shared_ptr film = _film.lock (); - if (!film) { + if (!film || film->length() == 0) { return; } diff --git a/test/resampler_test.cc b/test/resampler_test.cc index 1ef69b0c2..9247159a7 100644 --- a/test/resampler_test.cc +++ b/test/resampler_test.cc @@ -33,7 +33,7 @@ resampler_test_one (int from, int to) int total_out = 0; /* 3 hours */ - int64_t const N = from * 60 * 60 * 3; + int64_t const N = int64_t (from) * 60 * 60 * 3; for (int64_t i = 0; i < N; i += 1000) { shared_ptr a (new AudioBuffers (1, 1000)); -- cgit v1.2.3 From 7426d100653edd7fc71ec3e407ac67e2a07e6079 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Feb 2014 14:58:01 +0000 Subject: Add missing i18n attribution. --- src/wx/about_dialog.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 5f801bfe4..5fa5014f0 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -95,6 +95,7 @@ AboutDialog::AboutDialog (wxWindow* parent) translated_by.Add (wxT ("Lilian Lefranc")); translated_by.Add (wxT ("Thierry Journet")); translated_by.Add (wxT ("Massimiliano Broggi")); + translated_by.Add (wxT ("William Fanelli")); translated_by.Add (wxT ("Manuel AC")); translated_by.Add (wxT ("Adam Klotblixt")); translated_by.Add (wxT ("Markus Raab")); -- cgit v1.2.3 From b70f85bce27480c6c616a46807b3da9d2732d851 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 7 Feb 2014 15:59:44 +0000 Subject: Add basic stuff to build RPMs for Centos. Suggested-by: Manuel Weber --- ChangeLog | 4 + cscript | 110 ++++++---- platform/linux/dcpomatic.desktop.in | 2 +- platform/linux/dcpomatic.spec.in | 69 ++++++ platform/linux/dcpomatic_batch.desktop.in | 2 +- platform/linux/dcpomatic_server.desktop.in | 2 +- platform/linux/wscript | 14 +- src/lib/wscript | 4 +- src/tools/wscript | 8 +- src/wx/wscript | 8 +- test/wscript | 2 +- wscript | 334 ++++++++++++++++++----------- 12 files changed, 381 insertions(+), 178 deletions(-) create mode 100644 platform/linux/dcpomatic.spec.in (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 399b720ee..d04c76fb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-02-07 Carl Hetherington + + * Add basic stuff to build RPMs for Centos. + 2014-02-05 Carl Hetherington * Version 1.64.2 released. diff --git a/cscript b/cscript index 4103f9366..9595cb162 100644 --- a/cscript +++ b/cscript @@ -137,52 +137,88 @@ def build(target, options): if target.platform == 'windows': cmd += ' --target-windows' elif target.platform == 'linux': - cmd += ' --static' - target.command(cmd) + if target.distro == 'debian' or target.distro == 'ubuntu': + cmd += ' --target-debian' + elif target.distro == 'centos': + cmd += ' --target-centos' + target.command(cmd) target.command('./waf') if target.platform == 'linux' or target.platform == 'osx': target.command('./waf install') +def package_windows(target): + shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits) + target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits)) + target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits)) + target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.work_dir_cscript(), target.bits)) + target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits)) + target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits) + target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits) + return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0]) + +def package_debian(target, cpu): + make_control(target.version, target.bits, 'debian/control') + target.command('./waf dist') + f = open('debian/files', 'w') + print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu) + shutil.rmtree('build/deb', ignore_errors=True) + + os.makedirs('build/deb') + os.chdir('build/deb') + shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version) + target.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version) + os.chdir('dcpomatic-%s' % version) + target.command('dch -b -v %s-1 "New upstream release."' % version) + target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS')) + target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS')) + target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH')) + target.command('dpkg-buildpackage') + + debs = [] + for p in glob.glob('../*.deb'): + debs.append(os.path.abspath(p)) + + return debs + +def package_centos(target, cpu, version): + os.makedirs('%s/rpmbuild/BUILD' % target.work_dir_cdist()) + os.makedirs('%s/rpmbuild/RPMS' % target.work_dir_cdist()) + os.makedirs('%s/rpmbuild/SOURCES' % target.work_dir_cdist()) + os.makedirs('%s/rpmbuild/SPECS' % target.work_dir_cdist()) + os.makedirs('%s/rpmbuild/SRPMS' % target.work_dir_cdist()) + + f = open('%s/.rpmmacros' % target.dir_in_chroot, 'w') + print >>f,"%%_topdir %srpmbuild" % target.dir_in_chroot + f.close() + + target.command('./waf dist') + shutil.copyfile( + "%s/src/dcpomatic/dcpomatic-%s.tar.bz2" % (target.work_dir_cdist(), version), + "%s/rpmbuild/SOURCES/dcpomatic-%s.tar.bz2" % (target.work_dir_cdist(), version) + ) + + target.command('rpmbuild -bb build/platform/linux/dcpomatic.spec') + rpms = [] + for p in glob.glob('%s/rpmbuild/RPMS/x86_64/*.rpm' % target.work_dir_cdist()): + rpms.append(os.path.abspath(p)) + + return rpms + def package(target, version): + if target.bits == 32: + cpu = 'i386' + else: + cpu = 'amd64' + if target.platform == 'windows': - shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits) - target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits)) - target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits)) - target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.work_dir_cscript(), target.bits)) - target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits)) - target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits) - target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits) - return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0]) + return package_windows(target) elif target.platform == 'linux': - if target.bits == 32: - cpu = 'i386' - else: - cpu = 'amd64' - - make_control(target.version, target.bits, 'debian/control', target.debug) - target.command('./waf dist') - f = open('debian/files', 'w') - print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu) - shutil.rmtree('build/deb', ignore_errors=True) - - os.makedirs('build/deb') - os.chdir('build/deb') - shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version) - target.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version) - os.chdir('dcpomatic-%s' % version) - target.command('dch -b -v %s-1 "New upstream release."' % version) - target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS')) - target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS')) - target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH')) - target.command('dpkg-buildpackage') - - debs = [] - for p in glob.glob('../*.deb'): - debs.append(os.path.abspath(p)) - - return debs + if target.distro == 'debian' or target.distro == 'ubuntu': + return package_debian(target, cpu) + elif target.distro == 'centos': + return package_centos(target, cpu, version) elif target.platform == 'osx': target.command('bash platform/osx/make_dmg.sh %s' % target.work_dir_cscript()) return os.path.abspath(glob.glob('build/platform/osx/DCP-o-matic*.dmg')[0]) diff --git a/platform/linux/dcpomatic.desktop.in b/platform/linux/dcpomatic.desktop.in index aabd992f5..76e629404 100644 --- a/platform/linux/dcpomatic.desktop.in +++ b/platform/linux/dcpomatic.desktop.in @@ -3,7 +3,7 @@ Encoding=UTF-8 Version=1.0 Type=Application Terminal=false -Exec=@PREFIX@/bin/dcpomatic +Exec=@INSTALL_PREFIX@/bin/dcpomatic Name=DCP-o-matic Icon=dcpomatic Comment=DCP generator diff --git a/platform/linux/dcpomatic.spec.in b/platform/linux/dcpomatic.spec.in new file mode 100644 index 000000000..f373ebd67 --- /dev/null +++ b/platform/linux/dcpomatic.spec.in @@ -0,0 +1,69 @@ +Summary:A program that generates Digital Cinema Packages (DCPs) from video and audio files +Name:dcpomatic +Version:@version@ +Release:1%{?dist} +License:GPL +Group:Applications/Multimedia +URL:http://dcpomatic.com/ + +%description +DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio +files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant +digital projectors. + +%files +%{_bindir}/dcpomatic +%{_bindir}/dcpomatic_batch +%{_bindir}/dcpomatic_cli +%{_bindir}/dcpomatic_create +%{_bindir}/dcpomatic_kdm +%{_bindir}/dcpomatic_server +%{_bindir}/dcpomatic_server_cli +%{_datadir}/applications/dcpomatic.desktop +%{_datadir}/applications/dcpomatic_batch.desktop +%{_datadir}/applications/dcpomatic_server.desktop +%{_datadir}/dcpomatic/taskbar_icon.png +%{_datadir}/icons/hicolor/128x128/apps/dcpomatic.png +%{_datadir}/icons/hicolor/22x22/apps/dcpomatic.png +%{_datadir}/icons/hicolor/32x32/apps/dcpomatic.png +%{_datadir}/icons/hicolor/48x48/apps/dcpomatic.png +%{_datadir}/icons/hicolor/64x64/apps/dcpomatic.png +%{_datadir}/locale/de_DE/LC_MESSAGES/dcpomatic.mo +%{_datadir}/locale/de_DE/LC_MESSAGES/libdcpomatic-wx.mo +%{_datadir}/locale/de_DE/LC_MESSAGES/libdcpomatic.mo +%{_datadir}/locale/es_ES/LC_MESSAGES/dcpomatic.mo +%{_datadir}/locale/es_ES/LC_MESSAGES/libdcpomatic-wx.mo +%{_datadir}/locale/es_ES/LC_MESSAGES/libdcpomatic.mo +%{_datadir}/locale/fr_FR/LC_MESSAGES/dcpomatic.mo +%{_datadir}/locale/fr_FR/LC_MESSAGES/libdcpomatic-wx.mo +%{_datadir}/locale/fr_FR/LC_MESSAGES/libdcpomatic.mo +%{_datadir}/locale/it_IT/LC_MESSAGES/dcpomatic.mo +%{_datadir}/locale/it_IT/LC_MESSAGES/libdcpomatic-wx.mo +%{_datadir}/locale/it_IT/LC_MESSAGES/libdcpomatic.mo +%{_datadir}/locale/sv_SE/LC_MESSAGES/dcpomatic.mo +%{_datadir}/locale/sv_SE/LC_MESSAGES/libdcpomatic-wx.mo +%{_datadir}/locale/sv_SE/LC_MESSAGES/libdcpomatic.mo + +%prep +rm -rf $RPM_BUILD_DIR/dcpomatic-@version@ +tar xjf $RPM_SOURCE_DIR/dcpomatic-@version@.tar.bz2 +%build +cd dcpomatic-@version@ +export PKG_CONFIG_PATH=/home/carl/lib/pkgconfig:/usr/local/lib/pkgconfig +CXXFLAGS="-I/home/carl/include" LDFLAGS="-L/home/carl/lib" ./waf configure --prefix=%{buildroot}/usr --install-prefix=/usr --target-centos +./waf +%install +cd dcpomatic-@version@ +./waf install + +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : \ No newline at end of file diff --git a/platform/linux/dcpomatic_batch.desktop.in b/platform/linux/dcpomatic_batch.desktop.in index bab136e8a..ec32a7353 100644 --- a/platform/linux/dcpomatic_batch.desktop.in +++ b/platform/linux/dcpomatic_batch.desktop.in @@ -3,7 +3,7 @@ Encoding=UTF-8 Version=1.0 Type=Application Terminal=false -Exec=@PREFIX@/bin/dcpomatic_batch +Exec=@INSTALL_PREFIX@/bin/dcpomatic_batch Name=DCP-o-matic Batch Converter Icon=dcpomatic Comment=DCP generator diff --git a/platform/linux/dcpomatic_server.desktop.in b/platform/linux/dcpomatic_server.desktop.in index 7b8215e8f..c51c2778a 100644 --- a/platform/linux/dcpomatic_server.desktop.in +++ b/platform/linux/dcpomatic_server.desktop.in @@ -3,7 +3,7 @@ Encoding=UTF-8 Version=1.0 Type=Application Terminal=false -Exec=@PREFIX@/bin/dcpomatic_server +Exec=@INSTALL_PREFIX@/bin/dcpomatic_server Name=DCP-o-matic Encode Server Icon=dcpomatic Comment=DCP generator diff --git a/platform/linux/wscript b/platform/linux/wscript index 53a6efeac..fe6f4e2db 100644 --- a/platform/linux/wscript +++ b/platform/linux/wscript @@ -1,19 +1,25 @@ def build(bld): - d = { 'PREFIX' : '${PREFIX' } + d = { 'INSTALL_PREFIX' : bld.env.INSTALL_PREFIX } + d = { 'VERSION' : bld.env.VERSION } - obj = bld(features = 'subst') + obj = bld(features='subst') obj.source = 'dcpomatic.desktop.in' obj.target = 'dcpomatic.desktop' obj.dict = d - obj = bld(features = 'subst') + obj = bld(features='subst') obj.source = 'dcpomatic_batch.desktop.in' obj.target = 'dcpomatic_batch.desktop' obj.dict = d - obj = bld(features = 'subst') + obj = bld(features='subst') obj.source = 'dcpomatic_server.desktop.in' obj.target = 'dcpomatic_server.desktop' obj.dict = d + obj = bld(features='subst') + obj.source = 'dcpomatic.spec.in' + obj.target = 'dcpomatic.spec' + obj.dict = d + bld.install_files('${PREFIX}/share/applications', ['dcpomatic.desktop', 'dcpomatic_batch.desktop', 'dcpomatic_server.desktop']) diff --git a/src/lib/wscript b/src/lib/wscript index 81a55a160..4921afaee 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -65,7 +65,7 @@ sources = """ """ def build(bld): - if bld.env.STATIC: + if bld.env.BUILD_STATIC: obj = bld(features = 'cxx cxxstlib') else: obj = bld(features = 'cxx cxxshlib') @@ -84,7 +84,7 @@ def build(bld): if bld.env.TARGET_WINDOWS: obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE' obj.source += ' stack.cpp' - if bld.env.STATIC: + if bld.env.BUILD_STATIC: obj.uselib += ' XML++' obj.target = 'dcpomatic' diff --git a/src/tools/wscript b/src/tools/wscript index 0fd336676..131d02b81 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -11,17 +11,19 @@ def configure(conf): def build(bld): for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm', 'dcpomatic_create']: obj = bld(features = 'cxx cxxprogram') - obj.uselib = 'BOOST_THREAD OPENJPEG DCP CXML AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC WXWIDGETS QUICKMAIL' + obj.uselib = 'BOOST_THREAD BOOST_DATETIME OPENJPEG DCP CXML AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC WXWIDGETS QUICKMAIL' obj.includes = ['..'] obj.use = ['libdcpomatic'] obj.source = '%s.cc' % t obj.target = t + if t == 'server_test': + obj.install_path = None if not bld.env.DISABLE_GUI: for t in ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server']: obj = bld(features = 'cxx cxxprogram') - obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML WXWIDGETS QUICKMAIL' - if bld.env.STATIC: + obj.uselib = 'BOOST_THREAD BOOST_DATETIME OPENJPEG DCP CXML AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML WXWIDGETS QUICKMAIL' + if bld.env.BUILD_STATIC: obj.uselib += ' GTK' obj.includes = ['..'] obj.use = ['libdcpomatic', 'libdcpomatic-wx'] diff --git a/src/wx/wscript b/src/wx/wscript index 9de32d39e..1ffaa6097 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -47,13 +47,13 @@ sources = """ def configure(conf): args = '--cppflags --cxxflags' - if not conf.env.STATIC: + if not conf.env.BUILD_STATIC: args += ' --libs std,richtext' conf.check_cfg(msg='Checking for wxWidgets', package='', path=conf.options.wx_config, args=args, uselib_store='WXWIDGETS', mandatory=True) - if conf.env.STATIC: + if conf.env.BUILD_STATIC: # wx-config returns its static libraries as full paths, without -l prefixes, which confuses # check_cfg(), so just hard-code it all. conf.env.STLIB_WXWIDGETS = ['wx_gtk2u_richtext-3.0', 'wx_gtk2u_xrc-3.0', 'wx_gtk2u_qa-3.0', 'wx_baseu_net-3.0', 'wx_gtk2u_html-3.0', @@ -67,14 +67,14 @@ def configure(conf): conf.fatal('wxwidgets version 3.0.0 is required; %s found' % wx_version) def build(bld): - if bld.env.STATIC: + if bld.env.BUILD_STATIC: obj = bld(features = 'cxx cxxstlib') else: obj = bld(features = 'cxx cxxshlib') obj.name = 'libdcpomatic-wx' obj.export_includes = ['..'] - obj.uselib = 'WXWIDGETS' + obj.uselib = 'WXWIDGETS DCP' if bld.env.TARGET_LINUX: obj.uselib += ' GTK' obj.use = 'libdcpomatic' diff --git a/test/wscript b/test/wscript index c07f2cc33..676f47104 100644 --- a/test/wscript +++ b/test/wscript @@ -12,7 +12,7 @@ def configure(conf): def build(bld): obj = bld(features = 'cxx cxxprogram') obj.name = 'unit-tests' - obj.uselib = 'BOOST_TEST DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML' + obj.uselib = 'BOOST_TEST BOOST_THREAD DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML' obj.use = 'libdcpomatic' obj.source = """ 4k_test.cc diff --git a/wscript b/wscript index 076948395..95fb7f92c 100644 --- a/wscript +++ b/wscript @@ -11,29 +11,166 @@ def options(opt): opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation') opt.add_option('--disable-gui', action='store_true', default=False, help='disable building of GUI tools') - opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to Windows') - opt.add_option('--static', action='store_true', default=False, help='build statically, and link statically to libdcp and FFmpeg') + opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package') + opt.add_option('--target-debian', action='store_true', default=False, help='set up to compile for a Debian/Ubuntu package') + opt.add_option('--target-centos', action='store_true', default=False, help='set up to compile for a Centos package') opt.add_option('--magickpp-config', action='store', default='Magick++-config', help='path to Magick++-config') opt.add_option('--wx-config', action='store', default='wx-config', help='path to wx-config') opt.add_option('--address-sanitizer', action='store_true', default=False, help='build with address sanitizer') + opt.add_option('--install-prefix', default=None, help='prefix of where DCP-o-matic will be installed') + +def static_ffmpeg(conf): + conf.check_cfg(package='libavformat', args='--cflags', uselib_store='AVFORMAT', mandatory=True) + conf.env.STLIB_AVFORMAT = ['avformat'] + conf.check_cfg(package='libavfilter', args='--cflags', uselib_store='AVFILTER', mandatory=True) + conf.env.STLIB_AVFILTER = ['avfilter', 'swresample'] + conf.check_cfg(package='libavcodec', args='--cflags', uselib_store='AVCODEC', mandatory=True) + conf.env.STLIB_AVCODEC = ['avcodec'] + conf.env.LIB_AVCODEC = ['z'] + conf.check_cfg(package='libavutil', args='--cflags', uselib_store='AVUTIL', mandatory=True) + conf.env.STLIB_AVUTIL = ['avutil'] + conf.check_cfg(package='libswscale', args='--cflags', uselib_store='SWSCALE', mandatory=True) + conf.env.STLIB_SWSCALE = ['swscale'] + conf.check_cfg(package='libswresample', args='--cflags', uselib_store='SWRESAMPLE', mandatory=True) + conf.env.STLIB_SWRESAMPLE = ['swresample'] + conf.check_cfg(package='libpostproc', args='--cflags', uselib_store='POSTPROC', mandatory=True) + conf.env.STLIB_POSTPROC = ['postproc'] + +def dynamic_ffmpeg(conf): + conf.check_cfg(package='libavformat', args='--cflags --libs', uselib_store='AVFORMAT', mandatory=True) + conf.check_cfg(package='libavfilter', args='--cflags --libs', uselib_store='AVFILTER', mandatory=True) + conf.check_cfg(package='libavcodec', args='--cflags --libs', uselib_store='AVCODEC', mandatory=True) + conf.check_cfg(package='libavutil', args='--cflags --libs', uselib_store='AVUTIL', mandatory=True) + conf.check_cfg(package='libswscale', args='--cflags --libs', uselib_store='SWSCALE', mandatory=True) + conf.check_cfg(package='libswresample', args='--cflags --libs', uselib_store='SWRESAMPLE', mandatory=True) + conf.check_cfg(package='libpostproc', args='--cflags --libs', uselib_store='POSTPROC', mandatory=True) + +def static_openjpeg(conf): + conf.check_cfg(package='libopenjpeg', args='--cflags', atleast_version='1.5.0', uselib_store='OPENJPEG', mandatory=True) + conf.check_cfg(package='libopenjpeg', args='--cflags', max_version='1.5.1', mandatory=True) + conf.env.STLIB_OPENJPEG = ['openjpeg'] + +def static_dcp(conf, static_boost, static_xmlpp, static_xmlsec, static_ssh): + conf.check_cfg(package='libdcp', atleast_version='0.92', args='--cflags', uselib_store='DCP', mandatory=True) + conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] + conf.env.STLIB_DCP = ['dcp', 'asdcp-libdcp', 'kumu-libdcp'] + conf.env.LIB_DCP = ['glibmm-2.4', 'ssl', 'crypto', 'bz2', 'xslt'] + + if static_boost: + conf.env.STLIB_DCP.append('boost_system') -def pkg_config_args(conf): - if conf.env.STATIC: - return '--cflags' + if static_xmlpp: + conf.env.STLIB_DCP.append('xml++-2.6') else: - return '--cflags --libs' + conf.env.LIB_DCP.append('xml++-2.6') + + if static_xmlsec: + conf.env.STLIB_DCP.append('xmlsec1-openssl') + conf.env.STLIB_DCP.append('xmlsec1') + else: + conf.env.LIB_DCP.append('xmlsec1-openssl') + conf.env.LIB_DCP.append('xmlsec1') + + if static_ssh: + conf.env.STLIB_DCP.append('ssh') + else: + conf.env.LIB_DCP.append('ssh') + + + +def dynamic_dcp(conf): + conf.check_cfg(package='libdcp', atleast_version='0.92', args='--cflags --libs', uselib_store='DCP', mandatory=True) + conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] + +def dynamic_ssh(conf): + conf.check_cc(fragment=""" + #include \n + int main () {\n + ssh_session s = ssh_new ();\n + return 0;\n + } + """, msg='Checking for library libssh', mandatory=True, lib='ssh', uselib_store='SSH') + +def dynamic_boost(conf, lib_suffix, thread): + conf.check_cxx(fragment=""" + #include \n + #if BOOST_VERSION < 104500\n + #error boost too old\n + #endif\n + int main(void) { return 0; }\n + """, + mandatory=True, + msg='Checking for boost library >= 1.45', + okmsg='yes', + errmsg='too old\nPlease install boost version 1.45 or higher.') + + conf.check_cxx(fragment=""" + #include \n + int main() { boost::thread t (); }\n + """, msg='Checking for boost threading library', + libpath='/usr/local/lib', + lib=[thread, 'boost_system%s' % lib_suffix], + uselib_store='BOOST_THREAD') + + conf.check_cxx(fragment=""" + #include \n + int main() { boost::filesystem::copy_file ("a", "b"); }\n + """, msg='Checking for boost filesystem library', + libpath='/usr/local/lib', + lib=['boost_filesystem%s' % lib_suffix, 'boost_system%s' % lib_suffix], + uselib_store='BOOST_FILESYSTEM') + + conf.check_cxx(fragment=""" + #include \n + int main() { boost::gregorian::day_clock::local_day(); }\n + """, msg='Checking for boost datetime library', + libpath='/usr/local/lib', + lib=['boost_date_time%s' % lib_suffix, 'boost_system%s' % lib_suffix], + uselib_store='BOOST_DATETIME') + + conf.check_cxx(fragment=""" + #include \n + int main() { boost::signals2::signal x; }\n + """, + msg='Checking for boost signals2 library', + uselib_store='BOOST_SIGNALS2') + +def static_boost(conf, lib_suffix): + conf.env.STLIB_BOOST_THREAD = ['boost_thread'] + conf.env.STLIB_BOOST_FILESYSTEM = ['boost_filesystem%s' % lib_suffix] + conf.env.STLIB_BOOST_DATETIME = ['boost_date_time%s' % lib_suffix, 'boost_system%s' % lib_suffix] + conf.env.STLIB_BOOST_SIGNALS2 = ['boost_signals2'] + +def dynamic_quickmail(conf): + conf.check_cxx(fragment=""" + #include + int main(void) { quickmail_initialize (); } + """, + mandatory=True, + msg='Checking for libquickmail', + libpath='/usr/local/lib', + lib=['quickmail', 'curl'], + uselib_store='QUICKMAIL') def configure(conf): conf.load('compiler_cxx') if conf.options.target_windows: conf.load('winres') + # conf.options -> conf.env conf.env.TARGET_WINDOWS = conf.options.target_windows conf.env.DISABLE_GUI = conf.options.disable_gui - conf.env.STATIC = conf.options.static + conf.env.TARGET_DEBIAN = conf.options.target_debian + conf.env.TARGET_CENTOS = conf.options.target_centos conf.env.VERSION = VERSION conf.env.TARGET_OSX = sys.platform == 'darwin' conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX + # true if we should build dcpomatic/libdcpomatic/libdcpomatic-wx statically + conf.env.BUILD_STATIC = conf.options.target_debian or conf.options.target_centos + if conf.options.install_prefix is None: + conf.env.INSTALL_PREFIX = conf.env.PREFIX + else: + conf.env.INSTALL_PREFIX = conf.options.install_prefix # Common CXXFLAGS conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-D__STDC_LIMIT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', @@ -48,7 +185,11 @@ def configure(conf): conf.env.append_value('CXXFLAGS', ['-fsanitize=address', '-fno-omit-frame-pointer']) conf.env.append_value('LINKFLAGS', ['-fsanitize=address']) - # Windows-specific + # + # Platform-specific CFLAGS hacks and other tinkering + # + + # Windows if conf.env.TARGET_WINDOWS: conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE', '-DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN']) wxrc = os.popen('wx-config --rescomp').read().split()[1:] @@ -65,7 +206,7 @@ def configure(conf): boost_lib_suffix = '-mt' boost_thread = 'boost_thread_win32-mt' - # POSIX-specific + # POSIX if conf.env.TARGET_LINUX or conf.env.TARGET_OSX: conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX') conf.env.append_value('CXXFLAGS', '-DPOSIX_LOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX']) @@ -74,125 +215,55 @@ def configure(conf): boost_thread = 'boost_thread' conf.env.append_value('LINKFLAGS', '-pthread') - # Linux-specific + # Linux if conf.env.TARGET_LINUX: conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_LINUX') + + if conf.env.TARGET_DEBIAN: # libxml2 seems to be linked against this on Ubuntu but it doesn't mention it in its .pc file conf.check_cfg(package='liblzma', args='--cflags --libs', uselib_store='LZMA', mandatory=True) - if not conf.env.DISABLE_GUI: - if conf.env.STATIC: - conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True) - else: - # On Linux we need to be able to include to check GTK's version - conf.check_cfg(package='gtk+-2.0', args='--cflags', uselib_store='GTK', mandatory=True) - - # OSX-specific + + if not conf.env.DISABLE_GUI: + if conf.env.TARGET_DEBIAN or conf.env.TARGET_CENTOS: + conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True) + + # OSX if conf.env.TARGET_OSX: conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_OSX') conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names') - # Dependencies which are dynamically linked everywhere except --static - # Get libs only when we are dynamically linking - conf.check_cfg(package='libdcp', atleast_version='0.92', args=pkg_config_args(conf), uselib_store='DCP', mandatory=True) - # Remove erroneous escaping of quotes from xmlsec1 defines - conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] - conf.check_cfg(package='libcxml', atleast_version='0.08', args=pkg_config_args(conf), uselib_store='CXML', mandatory=True) - conf.check_cfg(package='libavformat', args=pkg_config_args(conf), uselib_store='AVFORMAT', mandatory=True) - conf.check_cfg(package='libavfilter', args=pkg_config_args(conf), uselib_store='AVFILTER', mandatory=True) - conf.check_cfg(package='libavcodec', args=pkg_config_args(conf), uselib_store='AVCODEC', mandatory=True) - conf.check_cfg(package='libavutil', args=pkg_config_args(conf), uselib_store='AVUTIL', mandatory=True) - conf.check_cfg(package='libswscale', args=pkg_config_args(conf), uselib_store='SWSCALE', mandatory=True) - conf.check_cfg(package='libswresample', args=pkg_config_args(conf), uselib_store='SWRESAMPLE', mandatory=True) - conf.check_cfg(package='libpostproc', args=pkg_config_args(conf), uselib_store='POSTPROC', mandatory=True) - conf.check_cfg(package='libopenjpeg', args=pkg_config_args(conf), atleast_version='1.5.0', uselib_store='OPENJPEG', mandatory=True) - conf.check_cfg(package='libopenjpeg', args=pkg_config_args(conf), max_version='1.5.1', mandatory=True) - - if conf.env.STATIC: - # This is hackio grotesquio for static builds (ie for .deb packages). We need to link some things - # statically and some dynamically, or things get horribly confused and the dynamic linker (I think) - # crashes. These calls do what the check_cfg calls would have done, but specify the - # different bits as static or dynamic as required. It'll break if you look at it funny, but - # I think anyone else who builds would do so dynamically. - conf.env.STLIB_CXML = ['cxml'] - conf.env.STLIB_DCP = ['dcp', 'asdcp-libdcp', 'kumu-libdcp'] - conf.env.LIB_DCP = ['glibmm-2.4', 'xml++-2.6', 'ssl', 'crypto', 'bz2', 'xmlsec1', 'xmlsec1-openssl', 'xslt'] - conf.env.STLIB_CXML = ['cxml'] - conf.env.STLIB_AVFORMAT = ['avformat'] - conf.env.STLIB_AVFILTER = ['avfilter', 'swresample'] - conf.env.STLIB_AVCODEC = ['avcodec'] - conf.env.LIB_AVCODEC = ['z'] - conf.env.STLIB_AVUTIL = ['avutil'] - conf.env.STLIB_SWSCALE = ['swscale'] - conf.env.STLIB_POSTPROC = ['postproc'] - conf.env.STLIB_SWRESAMPLE = ['swresample'] - conf.env.STLIB_OPENJPEG = ['openjpeg'] - conf.env.STLIB_QUICKMAIL = ['quickmail'] - else: - conf.check_cxx(fragment=""" - #include - int main(void) { quickmail_initialize (); } - """, - mandatory=True, - msg='Checking for libquickmail', - libpath='/usr/local/lib', - lib=['quickmail', 'curl'], - uselib_store='QUICKMAIL') - - # Dependencies which are always dynamically linked - conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True) - conf.check_cfg(package='glib-2.0', args='--cflags --libs', uselib_store='GLIB', mandatory=True) - conf.check_cfg(package= '', path=conf.options.magickpp_config, args='--cppflags --cxxflags --libs', uselib_store='MAGICK', mandatory=True) - conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True) - conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True) - conf.check_cfg(package='libzip', args='--cflags --libs', uselib_store='ZIP', mandatory=True) - - conf.check_cxx(fragment=""" - #include \n - #if BOOST_VERSION < 104500\n - #error boost too old\n - #endif\n - int main(void) { return 0; }\n - """, - mandatory=True, - msg='Checking for boost library >= 1.45', - okmsg='yes', - errmsg='too old\nPlease install boost version 1.45 or higher.') - - conf.check_cc(fragment=""" - #include \n - int main () {\n - ssh_session s = ssh_new ();\n - return 0;\n - } - """, msg='Checking for library libssh', mandatory=True, lib='ssh', uselib_store='SSH') - - conf.check_cxx(fragment=""" - #include \n - int main() { boost::thread t (); }\n - """, msg='Checking for boost threading library', - libpath='/usr/local/lib', - lib=[boost_thread, 'boost_system%s' % boost_lib_suffix], - uselib_store='BOOST_THREAD') + # + # Dependencies. + # There's probably a neater way of expressing these, but I've gone for brute force for now. + # + + if conf.env.TARGET_DEBIAN: + conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags', uselib_store='CXML', mandatory=True) + conf.env.STLIB_CXML = ['cxml'] + conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True) + conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True) + conf.env.STLIB_QUICKMAIL = ['quickmail'] + static_ffmpeg(conf) + static_openjpeg(conf) + static_dcp(conf, False, False, False, False) + dynamic_boost(conf, boost_lib_suffix, boost_thread) + + if conf.env.TARGET_CENTOS: + conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags --libs-only-L', uselib_store='CXML', mandatory=True) + conf.env.STLIB_CXML = ['cxml', 'boost_filesystem'] + conf.check_cfg(package='libcurl', args='--cflags --libs-only-L', uselib_store='CURL', mandatory=True) + conf.env.STLIB_CURL = ['curl'] + conf.env.LIB_CURL = ['ssh2', 'idn'] + conf.env.STLIB_QUICKMAIL = ['quickmail', 'curl'] + conf.env.LIB_QUICKMAIL = ['ssh2', 'idn'] + static_ffmpeg(conf) + static_openjpeg(conf) + static_dcp(conf, True, True, True, True) + static_boost(conf, boost_lib_suffix) - conf.check_cxx(fragment=""" - #include \n - int main() { boost::filesystem::copy_file ("a", "b"); }\n - """, msg='Checking for boost filesystem library', - libpath='/usr/local/lib', - lib=['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], - uselib_store='BOOST_FILESYSTEM') - - conf.check_cxx(fragment=""" - #include \n - int main() { boost::gregorian::day_clock::local_day(); }\n - """, msg='Checking for boost datetime library', - libpath='/usr/local/lib', - lib=['boost_date_time%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], - uselib_store='BOOST_DATETIME') - - # Only Windows versions require boost::locale, which is handy, as it was only introduced in - # boost 1.48 and so isn't (easily) available on old Ubuntus. if conf.env.TARGET_WINDOWS: + conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True) + conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True) conf.check_cxx(fragment=""" #include \n int main() { std::locale::global (boost::locale::generator().generate ("")); }\n @@ -200,13 +271,28 @@ def configure(conf): libpath='/usr/local/lib', lib=['boost_locale%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], uselib_store='BOOST_LOCALE') + dynamic_quickmail(conf) + dynamic_boost(conf, boost_lib_suffix, boost_thread) + dynamic_ffmpeg(conf) + dynamic_dcp(conf) + dynamic_ssh(conf) + + # Not packaging; just a straight build + if not conf.env.TARGET_WINDOWS and not conf.env.TARGET_DEBIAN and not conf.env.TARGET_CENTOS: + conf.check_cfg(package='libcxml', atleast_version='0.08', args='--cflags --libs', uselib_store='CXML', mandatory=True) + conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XML++', mandatory=True) + conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True) + dynamic_quickmail(conf) + dynamic_boost(conf, boost_lib_suffix, boost_thread) + dynamic_ffmpeg(conf) + dynamic_dcp(conf) + dynamic_ssh(conf) - conf.check_cxx(fragment=""" - #include \n - int main() { boost::signals2::signal x; }\n - """, - msg='Checking for boost signals2 library', - uselib_store='BOOST_SIGNALS2') + # Dependencies which are always dynamically linked + conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True) + conf.check_cfg(package='glib-2.0', args='--cflags --libs', uselib_store='GLIB', mandatory=True) + conf.check_cfg(package= '', path=conf.options.magickpp_config, args='--cppflags --cxxflags --libs', uselib_store='MAGICK', mandatory=True) + conf.check_cfg(package='libzip', args='--cflags --libs', uselib_store='ZIP', mandatory=True) conf.check_cc(fragment=""" #include -- cgit v1.2.3 From f64c80e4415fda3e7c7136b245086609cd605a50 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 8 Feb 2014 22:17:28 +0000 Subject: Fix exception when seeking with missing content. Reported-by: lukegb --- ChangeLog | 2 ++ src/lib/player.cc | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 474c8f70d..17eca5cfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-02-08 Carl Hetherington + * Fix exception when seeking with missing content (part of #317). + * Version 1.64.6 released. 2014-02-08 Carl Hetherington diff --git a/src/lib/player.cc b/src/lib/player.cc index 42551889b..49d954c58 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -456,6 +456,10 @@ Player::setup_pieces () for (ContentList::iterator i = content.begin(); i != content.end(); ++i) { + if (!(*i)->paths_valid ()) { + continue; + } + shared_ptr piece (new Piece (*i)); /* XXX: into content? */ -- cgit v1.2.3 From 8322da2c2ff305103ab1b180e79f470d30366699 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2014 22:20:59 +0000 Subject: Sleep for a minute between failed attempts to listen for server replies. --- src/lib/server_finder.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lib/server_finder.cc b/src/lib/server_finder.cc index 5b67d8048..c4d3dc357 100644 --- a/src/lib/server_finder.cc +++ b/src/lib/server_finder.cc @@ -104,6 +104,7 @@ try try { sock->accept (Config::instance()->server_port_base() + 1); } catch (std::exception& e) { + dcpomatic_sleep (60); continue; } -- cgit v1.2.3 From e4b65ba64c319281d6bff15e950ebce697c9621a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2014 22:21:31 +0000 Subject: Fix 1 crash on low memory. --- ChangeLog | 2 ++ src/lib/ffmpeg.cc | 3 ++- src/lib/image.cc | 8 ++++---- src/lib/util.cc | 13 +++++++++++++ src/lib/util.h | 1 + src/wx/film_viewer.cc | 10 +++++++++- 6 files changed, 31 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 1febaac51..4f0bce552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-02-09 Carl Hetherington + * Some small bits of increased low-memory stability. + * Version 1.64.7 released. 2014-02-08 Carl Hetherington diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index b7ae04b06..fae9baa2b 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -26,6 +26,7 @@ extern "C" { #include "ffmpeg.h" #include "ffmpeg_content.h" #include "exceptions.h" +#include "util.h" #include "i18n.h" @@ -85,7 +86,7 @@ FFmpeg::setup_general () av_register_all (); _file_group.set_paths (_ffmpeg_content->paths ()); - _avio_buffer = static_cast (av_malloc (_avio_buffer_size)); + _avio_buffer = static_cast (wrapped_av_malloc (_avio_buffer_size)); _avio_context = avio_alloc_context (_avio_buffer, _avio_buffer_size, 0, this, avio_read_wrapper, 0, avio_seek_wrapper); _format_context = avformat_alloc_context (); _format_context->pb = _avio_context; diff --git a/src/lib/image.cc b/src/lib/image.cc index 95bf2b04d..4722563c4 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -498,13 +498,13 @@ Image::Image (AVPixelFormat p, libdcp::Size s, bool aligned) void Image::allocate () { - _data = (uint8_t **) av_malloc (4 * sizeof (uint8_t *)); + _data = (uint8_t **) wrapped_av_malloc (4 * sizeof (uint8_t *)); _data[0] = _data[1] = _data[2] = _data[3] = 0; - _line_size = (int *) av_malloc (4 * sizeof (int)); + _line_size = (int *) wrapped_av_malloc (4 * sizeof (int)); _line_size[0] = _line_size[1] = _line_size[2] = _line_size[3] = 0; - _stride = (int *) av_malloc (4 * sizeof (int)); + _stride = (int *) wrapped_av_malloc (4 * sizeof (int)); _stride[0] = _stride[1] = _stride[2] = _stride[3] = 0; for (int i = 0; i < components(); ++i) { @@ -520,7 +520,7 @@ Image::allocate () seem to mind. The nasty + 1 in this malloc makes sure there is always a byte for that instruction to read safely. */ - _data[i] = (uint8_t *) av_malloc (_stride[i] * lines (i) + 1); + _data[i] = (uint8_t *) wrapped_av_malloc (_stride[i] * lines (i) + 1); } } diff --git a/src/lib/util.cc b/src/lib/util.cc index edb202df2..190bb42b1 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef DCPOMATIC_POSIX #include #include @@ -92,6 +93,7 @@ using std::istream; using std::numeric_limits; using std::pair; using std::cout; +using std::bad_alloc; using std::streampos; using boost::shared_ptr; using boost::thread; @@ -916,3 +918,14 @@ fit_ratio_within (float ratio, libdcp::Size full_frame) return libdcp::Size (full_frame.width, rint (full_frame.width / ratio)); } + +void * +wrapped_av_malloc (size_t s) +{ + void* p = av_malloc (s); + if (!p) { + throw bad_alloc (); + } + return p; +} + diff --git a/src/lib/util.h b/src/lib/util.h index 7dcd920b7..a229bbfc9 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -120,6 +120,7 @@ extern float get_required_float (std::multimap const & extern std::string get_required_string (std::multimap const & kv, std::string k); extern int get_optional_int (std::multimap const & kv, std::string k); extern std::string get_optional_string (std::multimap const & kv, std::string k); +extern void* wrapped_av_malloc (size_t); /** @class Socket * @brief A class to wrap a boost::asio::ip::tcp::socket with some things diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index fbca835c2..e24583d6c 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -45,6 +45,7 @@ using std::min; using std::max; using std::cout; using std::list; +using std::bad_alloc; using std::make_pair; using boost::shared_ptr; using boost::dynamic_pointer_cast; @@ -126,7 +127,14 @@ FilmViewer::set_film (shared_ptr f) return; } - _player = f->make_player (); + try { + _player = f->make_player (); + } catch (bad_alloc) { + error_dialog (this, _("There is not enough free memory to do that.")); + _film.reset (); + return; + } + _player->disable_audio (); _player->Video.connect (boost::bind (&FilmViewer::process_video, this, _1, _2, _5)); _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1)); -- cgit v1.2.3 From 02c400669a490617969a8f3924dd0bce0840a7b8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2014 22:28:38 +0000 Subject: Ignore exceptions from send_to on server-search broadcast. --- ChangeLog | 2 ++ src/lib/server_finder.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 4f0bce552..0d3633cbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-02-09 Carl Hetherington + * Possibly fix repeated no route to host errors in some cases. + * Some small bits of increased low-memory stability. * Version 1.64.7 released. diff --git a/src/lib/server_finder.cc b/src/lib/server_finder.cc index c4d3dc357..3d5825ad4 100644 --- a/src/lib/server_finder.cc +++ b/src/lib/server_finder.cc @@ -65,8 +65,12 @@ try while (1) { if (Config::instance()->use_any_servers ()) { /* Broadcast to look for servers */ - boost::asio::ip::udp::endpoint end_point (boost::asio::ip::address_v4::broadcast(), Config::instance()->server_port_base() + 1); - socket.send_to (boost::asio::buffer (data.c_str(), data.size() + 1), end_point); + try { + boost::asio::ip::udp::endpoint end_point (boost::asio::ip::address_v4::broadcast(), Config::instance()->server_port_base() + 1); + socket.send_to (boost::asio::buffer (data.c_str(), data.size() + 1), end_point); + } catch (...) { + + } } /* Query our `definite' servers (if there are any) */ -- cgit v1.2.3 From ed0d28374e5c4807f7375c39c032a1dc4b5cf874 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2014 23:34:24 +0000 Subject: Various OOM fixes; fancy terminate() handler. --- ChangeLog | 3 +++ src/lib/job.cc | 26 ++++++++++++++++---------- src/lib/log.cc | 5 +++++ src/lib/util.cc | 30 +++++++++++++++++++++++++++++- 4 files changed, 53 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 0d3633cbd..0a6f52959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-02-09 Carl Hetherington + * Build with a more careful version of libopenjpeg that handles + out-of-memory conditions slightly better. + * Possibly fix repeated no route to host errors in some cases. * Some small bits of increased low-memory stability. diff --git a/src/lib/job.cc b/src/lib/job.cc index 9981934ec..66fa3755d 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -68,9 +68,6 @@ Job::run_wrapper () } catch (libdcp::FileError& e) { - set_progress (1); - set_state (FINISHED_ERROR); - string m = String::compose (_("An error occurred whilst handling the file %1."), boost::filesystem::path (e.filename()).leaf()); try { @@ -84,39 +81,48 @@ Job::run_wrapper () } set_error (e.what(), m); - - } catch (OpenFileError& e) { - set_progress (1); set_state (FINISHED_ERROR); + + } catch (OpenFileError& e) { set_error ( String::compose (_("Could not open %1"), e.file().string()), String::compose (_("DCP-o-matic could not open the file %1. Perhaps it does not exist or is in an unexpected format."), e.file().string()) ); + set_progress (1); + set_state (FINISHED_ERROR); + } catch (boost::thread_interrupted &) { set_state (FINISHED_CANCELLED); - - } catch (std::exception& e) { + } catch (std::bad_alloc& e) { + + set_error (_("Out of memory"), _("There was not enough memory to do this.")); set_progress (1); set_state (FINISHED_ERROR); + + } catch (std::exception& e) { + set_error ( e.what (), _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)") ); - } catch (...) { - set_progress (1); set_state (FINISHED_ERROR); + + } catch (...) { + set_error ( _("Unknown error"), _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)") ); + set_progress (1); + set_state (FINISHED_ERROR); } } diff --git a/src/lib/log.cc b/src/lib/log.cc index 9ddf460d4..e79f0e201 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -104,6 +104,11 @@ void FileLog::do_log (string m) { FILE* f = fopen_boost (_file, "a"); + if (!f) { + cout << m << "\n"; + return; + } + fprintf (f, "%s\n", m.c_str ()); fclose (f); } diff --git a/src/lib/util.cc b/src/lib/util.cc index 190bb42b1..d0274e821 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -95,6 +95,7 @@ using std::pair; using std::cout; using std::bad_alloc; using std::streampos; +using std::set_terminate; using boost::shared_ptr; using boost::thread; using boost::lexical_cast; @@ -273,6 +274,31 @@ LONG WINAPI exception_handler(struct _EXCEPTION_POINTERS *) } #endif +/* From http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c */ +void +terminate () +{ + static bool tried_throw = false; + + try { + // try once to re-throw currently active exception + if (!tried_throw++) { + throw; + } + } + catch (const std::exception &e) { + std::cerr << __FUNCTION__ << " caught unhandled exception. what(): " + << e.what() << std::endl; + } + catch (...) { + std::cerr << __FUNCTION__ << " caught unknown/unhandled exception." + << std::endl; + } + + stacktrace (cout, 50); + abort(); +} + /** Call the required functions to set up DCP-o-matic's static arrays, etc. * Must be called from the UI thread, if there is one. */ @@ -309,7 +335,9 @@ dcpomatic_setup () boost::filesystem::path lib = app_contents (); lib /= "lib"; setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1); -#endif +#endif + + set_terminate (terminate); libdcp::init (); -- cgit v1.2.3 From 5832c7851a946890f04d6d1c548c23d563249e9f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 10 Feb 2014 11:24:01 +0000 Subject: Fix windows build. --- src/lib/util.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/util.cc b/src/lib/util.cc index d0274e821..b2f8c4470 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -295,7 +295,9 @@ terminate () << std::endl; } +#ifdef DCPOMATIC_POSIX stacktrace (cout, 50); +#endif abort(); } -- cgit v1.2.3 From f354ad0ed0824e80b8afa943039422cb493b9f24 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 10 Feb 2014 17:48:22 +0000 Subject: Fix failure to update player after fix-missing. --- src/lib/player.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lib/player.cc b/src/lib/player.cc index 49d954c58..59db923be 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -545,6 +545,7 @@ Player::content_changed (weak_ptr w, int property, bool frequent) } else if (property == ContentProperty::PATH) { + _have_valid_pieces = false; Changed (frequent); } } -- cgit v1.2.3 From ddb66437383352d6a52bb36ef366f942c3155901 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 10 Feb 2014 17:48:32 +0000 Subject: Improve emergency log file message slightly. --- src/lib/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/log.cc b/src/lib/log.cc index e79f0e201..a0b031589 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -105,7 +105,7 @@ FileLog::do_log (string m) { FILE* f = fopen_boost (_file, "a"); if (!f) { - cout << m << "\n"; + cout << "(could not log to " << _file.string() << "): " << m << "\n"; return; } -- cgit v1.2.3 From 24ef3197488f259f2ec62aefd4ca15bac6797454 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 11 Feb 2014 09:50:33 +0000 Subject: Fix crash at the end of encodes. --- src/lib/transcode_job.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index f0e22da64..5c195ee1b 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -100,17 +100,20 @@ TranscodeJob::status () const int TranscodeJob::remaining_time () const { - if (!_transcoder) { + /* _transcoder might be destroyed by the job-runner thread */ + shared_ptr t = _transcoder; + + if (!t) { return 0; } - float fps = _transcoder->current_encoding_rate (); + float fps = t->current_encoding_rate (); if (fps == 0) { return 0; } /* Compute approximate proposed length here, as it's only here that we need it */ - OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - _transcoder->video_frames_out(); + OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - t->video_frames_out(); return left / fps; } -- cgit v1.2.3 From b731111427d94da2e3e231892c6e6edf3dd3f40f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 11 Feb 2014 09:51:06 +0000 Subject: Catch std::exception, not just KDMError, from KDM creation. --- ChangeLog | 4 ++++ src/tools/dcpomatic.cc | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index ba21e4cb5..38d9b667e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-02-11 Carl Hetherington + + * Be more careful when catching exceptions from KDM creation. + 2014-02-10 Carl Hetherington * Version 1.64.10 released. diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 1e60d9690..70e675e40 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -474,8 +474,10 @@ private: shared_ptr (new SendKDMEmailJob (film, d->screens (), d->dcp (), d->from (), d->until ())) ); } - } catch (KDMError& e) { + } catch (exception& e) { error_dialog (this, e.what ()); + } catch (...) { + error_dialog (this, _("An unknown exeception occurred.")); } d->Destroy (); -- cgit v1.2.3