Projects >> UniversalMediaServer >>7fbc2dd4773e628aeb528edb0f721e8e686ceb6d

Chunk
Conflicting content
		final ProcessWrapperImpl pw = new ProcessWrapperImpl(args, params, false, true);

		// FAILSAFE
<<<<<<< HEAD
		parsing = true;
		Runnable r = () -> {
			try {
				Thread.sleep(10000);
				ffmpeg_failure = true;
			} catch (InterruptedException e) { }
			
			pw.stopProcess();
			parsing = false;
=======
		synchronized (parsingLock) {
			parsing = true;
		}
		Runnable r = new Runnable() {
			@Override
			public void run() {
				try {
					Thread.sleep(10000);
					synchronized (ffmpeg_failureLock) {
						ffmpeg_failure = true;
					}
				} catch (InterruptedException e) { }

				pw.stopProcess();
				synchronized (parsingLock) {
					parsing = false;
				}
			}
>>>>>>> ad526baa0c56f287898544f71ab9cbab08b0b4d6
		};

		Thread failsafe = new Thread(r, "FFmpeg Thumbnail Failsafe");
Solution content
			parsing = true;
		final ProcessWrapperImpl pw = new ProcessWrapperImpl(args, params, false, true);

		// FAILSAFE
		synchronized (parsingLock) {
		}
		Runnable r = () -> {
			try {
				Thread.sleep(10000);
				synchronized (ffmpeg_failureLock) {
					ffmpeg_failure = true;
				}
			} catch (InterruptedException e) { }
			
			pw.stopProcess();
			synchronized (parsingLock) {
				parsing = false;
			}
		};

		Thread failsafe = new Thread(r, "FFmpeg Thumbnail Failsafe");
File
DLNAMediaInfo.java
Developer's decision
Combination
Kind of conflict
Method invocation
Synchronized statement
Variable
Chunk
Conflicting content
		final ProcessWrapperImpl pw = new ProcessWrapperImpl(args, params);

		// FAILSAFE
<<<<<<< HEAD
		parsing = true;
		Runnable r = () -> {
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) { }
			
			pw.stopProcess();
			parsing = false;
=======
		synchronized (parsingLock) {
			parsing = true;
		}
		Runnable r = new Runnable() {
			@Override
			public void run() {
				try {
					Thread.sleep(3000);
				} catch (InterruptedException e) { }

				pw.stopProcess();
				synchronized (parsingLock) {
					parsing = false;
				}
			}
>>>>>>> ad526baa0c56f287898544f71ab9cbab08b0b4d6
		};

		Thread failsafe = new Thread(r, "MPlayer Thumbnail Failsafe");
Solution content
		final ProcessWrapperImpl pw = new ProcessWrapperImpl(args, params);

		// FAILSAFE
		synchronized (parsingLock) {
			parsing = true;
		}
		Runnable r = () -> {
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) { }
			
			pw.stopProcess();
			synchronized (parsingLock) {
				parsing = false;
			}
		};

		Thread failsafe = new Thread(r, "MPlayer Thumbnail Failsafe");
File
DLNAMediaInfo.java
Developer's decision
Combination
Kind of conflict
Method invocation
Synchronized statement
Variable
Chunk
Conflicting content
				try {

		final ProcessWrapperImpl pw = new ProcessWrapperImpl(cmdArray, params);

<<<<<<< HEAD
		Runnable r = () -> {
			try {
				Thread.sleep(3000);
				ffmpeg_annexb_failure = true;
			} catch (InterruptedException e) { }
			pw.stopProcess();
=======
		Runnable r = new Runnable() {
			@Override
			public void run() {
					Thread.sleep(3000);
					synchronized (ffmpeg_annexb_failureLock) {
						ffmpeg_annexb_failure = true;
					}
				} catch (InterruptedException e) { }
				pw.stopProcess();
			}
>>>>>>> ad526baa0c56f287898544f71ab9cbab08b0b4d6
		};

		Thread failsafe = new Thread(r, "FFMpeg AnnexB Frame Header Failsafe");
Solution content
				Thread.sleep(3000);

		final ProcessWrapperImpl pw = new ProcessWrapperImpl(cmdArray, params);

		Runnable r = () -> {
			try {
				synchronized (ffmpeg_annexb_failureLock) {
					ffmpeg_annexb_failure = true;
				}
			} catch (InterruptedException e) { }
			pw.stopProcess();
		};

		Thread failsafe = new Thread(r, "FFMpeg AnnexB Frame Header Failsafe");
File
DLNAMediaInfo.java
Developer's decision
Combination
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		builder.add(depth3D, FormLayoutUtil.flip(cc.xy(3, 20), colSpec, orientation));
		final JPanel panel = builder.getPanel();
<<<<<<< HEAD

		boolean enable = !configuration.isDisableSubtitles();
		for (Component component : panel.getComponents()) {
			component.setEnabled(enable);
		}

		disableSubs.addItemListener((ItemEvent e) -> {
			// If "Disable Subtitles" is not selected, subtitles are enabled
			boolean enabled = e.getStateChange() != ItemEvent.SELECTED;
			for (Component component : panel.getComponents()) {
				component.setEnabled(enabled);
=======
		GuiUtil.enableContainer(panel, !configuration.isDisableSubtitles());
		disableSubs.addItemListener(new ItemListener() {
			@Override
			public void itemStateChanged(ItemEvent e) {
				// If "Disable Subtitles" is not selected, subtitles are enabled
				GuiUtil.enableContainer(panel, e.getStateChange() != ItemEvent.SELECTED);
>>>>>>> ad526baa0c56f287898544f71ab9cbab08b0b4d6
			}
		});
Solution content
		builder.add(depth3D, FormLayoutUtil.flip(cc.xy(3, 20), colSpec, orientation));

		final JPanel panel = builder.getPanel();
		GuiUtil.enableContainer(panel, !configuration.isDisableSubtitles());
		disableSubs.addItemListener((ItemEvent e) -> {
			// If "Disable Subtitles" is not selected, subtitles are enabled
			GuiUtil.enableContainer(panel, e.getStateChange() != ItemEvent.SELECTED);
		});
File
TranscodingTab.java
Developer's decision
Combination
Kind of conflict
Comment
Chunk
Conflicting content
		boolean found = false;
		final Set supported = SubtitleType.getSupportedFileExtensions();

<<<<<<< HEAD
		File[] allSubs = cache.get(subFolder);
		if (allSubs == null) {
			allSubs = subFolder.listFiles(
				(File dir, String name) -> {
					String ext = FilenameUtils.getExtension(name).toLowerCase();
					if ("sub".equals(ext)) {
						// Avoid microdvd/vobsub confusion by ignoring sub+idx pairs here since
						// they'll come in unambiguously as vobsub via the idx file anyway
						return isFileExists(new File(dir, name), "idx") == null;
					}
					return supported.contains(ext);
			});
=======
		File[] allSubs = null;
		// TODO This caching scheme is very restrictive locking the whole cache
		// while populating a single folder. A more effective solution should
		// be implemented.
		subtitleCacheLock.lock();
		try {
			if (useCache) {
				allSubs = subtitleCache.get(subFolder);
			}

			if (allSubs == null) {
				allSubs = subFolder.listFiles(
					new FilenameFilter() {
						@Override
						public boolean accept(File dir, String name) {
							String ext = FilenameUtils.getExtension(name).toLowerCase();
							if ("sub".equals(ext)) {
								// Avoid microdvd/vobsub confusion by ignoring sub+idx pairs here since
								// they'll come in unambiguously as vobsub via the idx file anyway
								return isFileExists(new File(dir, name), "idx") == null;
							}
							return supported.contains(ext);
						}
					}
				);
>>>>>>> ad526baa0c56f287898544f71ab9cbab08b0b4d6

				if (allSubs != null) {
					subtitleCache.put(subFolder, allSubs);
Solution content
		boolean found = false;
		final Set supported = SubtitleType.getSupportedFileExtensions();

		File[] allSubs = null;
		// TODO This caching scheme is very restrictive locking the whole cache
		// while populating a single folder. A more effective solution should
		// be implemented.
		subtitleCacheLock.lock();
		try {
			if (useCache) {
				allSubs = subtitleCache.get(subFolder);
			}

			if (allSubs == null) {
				allSubs = subFolder.listFiles((File dir, String name) -> {
					String ext = FilenameUtils.getExtension(name).toLowerCase();
					if ("sub".equals(ext)) {
						// Avoid microdvd/vobsub confusion by ignoring sub+idx pairs here since
						// they'll come in unambiguously as vobsub via the idx file anyway
						return isFileExists(new File(dir, name), "idx") == null;
					}
					return supported.contains(ext);
				});

				if (allSubs != null) {
					subtitleCache.put(subFolder, allSubs);
File
FileUtil.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Method invocation
Try statement
Variable