RandomEngy / VidCoder

A Blu-ray, DVD and video file transcoder for Windows.
http://vidcoder.net
GNU General Public License v2.0
706 stars 42 forks source link

ENHANCEMENT: Use HandBrake core from HandBrake install if newer #394

Open bcurran3 opened 6 years ago

bcurran3 commented 6 years ago

RE: change log notes - "Updated HandBrake core."

PRIORITY: LOW

Would it be possible to search for and use "HandBrake core" if a newer version was found within a HandBrake installation? This could be implemented and controlled (toggle and location) through a configuration setting.

PROS:

CONS:

VidCoder 4.12.-beta:

image

HandBrake 1.1.2:

image

(hb.dll doesn't display a version)

RandomEngy commented 6 years ago

One trouble with that is hb.dll lies in the "program files" portion which is needs privilege elevation to access and is normally only touched by installers. I'd also need some way to unload the DLL before swapping it as it would be in use as the program is running, which means either modifying a lot of places to be friendly to reload or making a separate hb.dll installer. It would be straight up impossible on the store version.

If you're enthusiastic about the upgrade, you can always copy/paste the DLL yourself and give things a try, but I'm not sure a program supported DLL swap-out is the best way to approach getting the latest version.

bcurran3 commented 6 years ago

One trouble with that is hb.dll lies in the "program files" portion which is needs privilege elevation to access and is normally only touched by installers.

That would only seem true in replacing the file. %ProgramFiles% needs no special access to read files. Both HandBrake, VidCoder/VidCoder-Beta install here. I don't see why the file couldn't be read with normal user access. Under normal conditions anyone/any program that can read hb.dll from the VidCoder directory should be able to read it from the HandBrake directory.

I'd also need some way to unload the DLL before swapping it as it would be in use as the program is running, which means either modifying a lot of places to be friendly to reload or making a separate hb.dll installer.

My suggestion is basically to look for it, compare versions, and load from the HandBrake directory if newer. No need to unload if checking before load time. This would be part of a pre-check and conditional.

It would be straight up impossible on the store version.

Store version? Ahhh, found it: https://www.microsoft.com/en-us/p/vidcoder/9n78dhwz3djx Didn't know it was there!

RandomEngy commented 6 years ago

The problem is that the way DLL searching happens is it checks the current directory first and uses it there before it will check other directories. So you'd need to delete or rename the hb.dll in the VidCoder program files directory.

Have you tried renaming hb.dll in VidCoder's directory and copying in the one from HandBrake?

bcurran3 commented 6 years ago

(I can't find the code where hb.dll is loaded!)

Sounds like you're using a library call to search, find, and load the .dll. Can't you search for the file in multiple locations first and then make the call to load the specific file?

Have you tried renaming hb.dll in VidCoder's directory and copying in the one from HandBrake?

No. I'm sure it would work. VidCoder already works very well. You're fast on updates. I don't track the changes to HandBrake (at all). I'm not that amendment about it, thus the low priority. I think this is a good enhancement request though that might be easy to implement.

Since VC relies on HB, it's always that thought of... "What if @RandomEngy gets hit by a bus?" :)

RandomEngy commented 6 years ago

No, I don't have code that looks for the DLL. That's a standard built-in function of the system to look for it. You can specify a DLLImport attribute to tell it to look somewhere, but it will always check the current directory first when searching for the DLL.

Anyway, long story short, the solution would be a bit messy.