Example #1
0
        private void OnExited(NonInteractiveProcessState processState, int exitCode, ReleaseMedium releaseMedium, Playlist playlist, List <Track> selectedTracks, string outputMKVPath)
        {
            LogExit(processState, exitCode);

            _tempFileRegistrar.DeleteTempFiles(_progressFilePath, _inputFileListPath);

            if (processState != NonInteractiveProcessState.Completed)
            {
                return;
            }

            var coverArt = releaseMedium != null?releaseMedium.CoverArtImages.FirstOrDefault(image => image.IsSelected) : null;

            var coverArtImage = coverArt != null ? coverArt.Image : null;
            var mkvPropEdit   = new MkvPropEdit(_jobObjectManager, _tempFileRegistrar)
            {
                SourceFilePath = outputMKVPath
            }
            .RemoveAllTags()
            .AddCoverArt(coverArtImage)
            .SetChapters(playlist.Chapters)
//                .SetDefaultTracksAuto(selectedTracks) // Breaks MediaInfo
            ;

            mkvPropEdit.Start();
        }
Example #2
0
        private void OnExited(NonInteractiveProcessState state, int exitCode, Exception exception, TimeSpan runTime)
        {
            Logger.InfoFormat("FFmpeg exited with state {0} and code {1}", state, exitCode);

            _exception = _exception ?? exception;

            if (_exception == null && state != NonInteractiveProcessState.Completed)
            {
                try
                {
                    if (state == NonInteractiveProcessState.Killed)
                    {
                        throw new FFmpegException("FFmpeg was canceled", new OperationCanceledException())
                              {
                                  IsReportable = false
                              };
                    }
                    throw new FFmpegException(string.Format("FFmpeg exited with state: {0}", state))
                          {
                              IsReportable = true
                          };
                }
                catch (FFmpegException e)
                {
                    _exception = e;
                }
            }

            SignalThreadExited();
        }
Example #3
0
 private void FFmpegOnExited(NonInteractiveProcessState state, int exitCode, Exception exception, TimeSpan runTime)
 {
     Logger.InfoFormat("FFmpeg exited with state {0} and code {1}", state, exitCode);
     if (state != NonInteractiveProcessState.Completed)
     {
         if (state == NonInteractiveProcessState.Killed)
         {
             _exception = exception ?? new OperationCanceledException(string.Format("FFmpeg exited with state: {0}", state));
         }
         else
         {
             _exception = exception ?? new Exception(string.Format("FFmpeg exited with state: {0}", state));
         }
     }
     SignalThreadExited();
 }
Example #4
0
        private static void LogExit(NonInteractiveProcessState processState, int exitCode)
        {
            const string message = "FFmpeg exited with state {0} and code {1}";

            switch (processState)
            {
            case NonInteractiveProcessState.Completed:
                Logger.InfoFormat(message, processState, exitCode);
                break;

            case NonInteractiveProcessState.Killed:
                Logger.WarnFormat(message, processState, exitCode);
                break;

            default:
                Logger.ErrorFormat(message, processState, exitCode);
                break;
            }
        }
Example #5
0
        private void OnExited(NonInteractiveProcessState processState, int exitCode, ReleaseMedium releaseMedium, Playlist playlist, string outputMKVPath)
        {
            LogExit(processState, exitCode);

            DeleteTempFilesAsync();

            if (processState != NonInteractiveProcessState.Completed)
            {
                return;
            }

            var mkvPropEdit = new MkvPropEdit(_jobObjectManager, _tempFileRegistrar)
            {
                SourceFilePath = outputMKVPath
            }
            .RemoveAllTags()
            .AddCoverArt(releaseMedium)
            .SetChapters(playlist.Chapters)
//                .SetDefaultTracksAuto(selectedTracks) // Breaks MediaInfo
            ;

            mkvPropEdit.Start();
        }
Example #6
0
 private void FFmpegOnExited(NonInteractiveProcessState state, int exitCode, Exception exception, TimeSpan runTime)
 {
     Logger.InfoFormat("FFmpeg exited with state {0} and code {1}", state, exitCode);
     if (state != NonInteractiveProcessState.Completed)
     {
         if (state == NonInteractiveProcessState.Killed)
         {
             _exception = exception ?? new OperationCanceledException(string.Format("FFmpeg exited with state: {0}", state));
         }
         else
         {
             _exception = exception ?? new Exception(string.Format("FFmpeg exited with state: {0}", state));
         }
     }
     SignalThreadExited();
 }
Example #7
0
        private void OnExited(NonInteractiveProcessState processState, int exitCode, ReleaseMedium releaseMedium, Playlist playlist, List<Track> selectedTracks, string outputMKVPath)
        {
            LogExit(processState, exitCode);

            _tempFileRegistrar.DeleteTempFiles(_progressFilePath, _inputFileListPath);

            if (processState != NonInteractiveProcessState.Completed)
                return;

            var coverArt = releaseMedium != null ? releaseMedium.CoverArtImages.FirstOrDefault(image => image.IsSelected) : null;
            var coverArtImage = coverArt != null ? coverArt.Image : null;
            var mkvPropEdit = new MkvPropEdit(_jobObjectManager, _tempFileRegistrar) { SourceFilePath = outputMKVPath }
                .RemoveAllTags()
                .AddCoverArt(coverArtImage)
                .SetChapters(playlist.Chapters)
            //                .SetDefaultTracksAuto(selectedTracks) // Breaks MediaInfo
            ;
            mkvPropEdit.Start();
        }
Example #8
0
 private static void LogExit(NonInteractiveProcessState processState, int exitCode)
 {
     const string message = "FFmpeg exited with state {0} and code {1}";
     switch (processState)
     {
         case NonInteractiveProcessState.Completed:
             Logger.DebugFormat(message, processState, exitCode);
             break;
         case NonInteractiveProcessState.Killed:
             Logger.WarnFormat(message, processState, exitCode);
             break;
         default:
             Logger.ErrorFormat(message, processState, exitCode);
             break;
     }
 }
Example #9
0
        private void OnExited(NonInteractiveProcessState state, int exitCode, ReleaseMedium releaseMedium, Playlist playlist, string outputMKVPath)
        {
//            _tempFileRegistrar.DeleteTempFiles("", "", "");
        }