Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
28th September 2011, 01:45 | #1001 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Sorry, yet another try
http://pastie.org/private/zj0ks6ji33qy4f3xcjyw7w It seems that a simple "_setmode(_fileno(stdout), _O_U8TEXT)" is sufficient to make 'wcout' output proper UTF-8 to the console (or to a redirected file). Also, as far as I have tested, this will even handle the SetConsoleOutputCP() stuff for us, making the code even shorter! Only problem, so far, is that the normal 'cout' will not work anymore. In "release" builds it will trigger a crash, in "debug" builds it will trigger an assertion in some CRT code. (Not really a problem, I think, because you have those macros for string/text output. However I saw some plain cout's in debug code inside MediaInfoLib)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 28th September 2011 at 01:55. |
28th September 2011, 17:00 | #1002 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
29th September 2011, 15:23 | #1003 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
I see. You are of course right to use _MSC_VER instead of __WINDOWS__ for the compiler-specific stuff.
However shouldn't the TEXTOUT macro use Ztring().From_ISO_8859_1() instead of Ztring().From_Local() to convert the C-string? As far as I see, TEXTOUT is mainly used to print some hardcoded strings that look like Latin-1. The user's "local" Codepage, however, might be everything... (I know that the ASCII characters, code 0 to 127, are identical for most Codepages. But not for all of them: e.g. Windows-932 has no backslash!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 29th September 2011 at 15:31. |
29th September 2011, 15:29 | #1004 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
This would be same, I use it only for pure US text string. Don't focus of such quick and dirty parts of the code.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
29th September 2011, 15:52 | #1005 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Well, if, for example, your "US text string" contains a backslash and the user has configured Windows-932 (Japanese Shift-JIS) as its default Codepage, then we would get a Yen symbol in the Unicode output instead of a backslash symbol after piping the text through a From_Local(), I think.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
30th September 2011, 22:52 | #1006 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Sorry, yet another suggestion
Code:
//Initialize terminal (to fix Unicode output on Win32) #if defined(_MSC_VER) && defined(UNICODE) _setmode(_fileno(stdout), _O_U8TEXT); _setmode(_fileno(stderr), _O_U8TEXT); if(_ftelli64(stdout) == 0I64) fwprintf(stdout, L"\uFEFF"); if(_ftelli64(stderr) == 0I64) fwprintf(stderr, L"\uFEFF"); #endif Always writing the BOM is not a good idea, because we might be redirecting to a non-empty file and we don't want the BOM somewhere in the middle of the file. Also we don't want to write a BOM to the console, as it produces an ugly ▯ character. But this won't happen, because _ftelli64() will return -1 in that case.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
30th September 2011, 23:17 | #1007 | Link |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
I prefer not to force it by default (Unicode specs says "Use of a BOM is neither required nor recommended for UTF-8"), I added it as an option.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
30th September 2011, 23:39 | #1008 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
3rd October 2011, 13:39 | #1009 | Link |
Registered User
Join Date: Sep 2006
Posts: 2,197
|
is there any way to deal with faster recognition of broken files?
when hovering over certain files with cursor or just selecting those with the mouse (e.g. .mkv files gotten from canceling mkvmerge muxing process or eac3to processing), then detecting takes really long and this is really annoying when just accidentally selecting such files or even trying to delete them.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack) |
3rd October 2011, 14:45 | #1011 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
Provide some files so I can see the reason your files are long to parse.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
3rd October 2011, 15:57 | #1012 | Link |
Registered User
Join Date: Sep 2006
Posts: 2,197
|
Im not entirely sure if that problem is really due to mediainfo. but on the other hand, I dont know which other progs/tools would parse files in explorer and cause such a system lock.
providing files, doesnt really work that well, because such broken files are quite large (blu-ray sources)
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack) |
3rd October 2011, 16:09 | #1013 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
large file from Blu-ray or blu-ray themselfs are not an issue on my side. I can provide a private FTP server for upload if needed. If you don't provide samples, I can not work this issue...
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
3rd October 2011, 22:17 | #1014 | Link |
Registered User
Join Date: Sep 2006
Posts: 2,197
|
does mediainfo also parse blu-ray playlist files? if not, then it might be an issue of lavsplitter or haali
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack) |
3rd October 2011, 22:35 | #1015 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
I'll check next week (I am not at home this week) my few blu-rays, if I have slow parsing with one, I'll try to fix it, else I'll do nothing until I have files with issues.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
4th October 2011, 16:32 | #1016 | Link |
Registered User
Join Date: Sep 2006
Posts: 2,197
|
one example is the south pacific blu-ray (ger, BBC documentary). playlist file 00001.mpls has file 00001.m2ts listed ~240 times after another (according to eac3to), a 1 min 1080p VC-1 file. so the overall playlist length is 4 hours.
this is obviously some garbage list and not really useful for the different episodes in reality. maybe it would be possible to deactivate parsing for such playlist files which have the same .m2ts files listed a certain number of times after another. (5-10 times just to be sure? maybe still too much in case such a file should be larger though) even in case of seamless branching stuff and alike with lots of different parts, usually the same part is not even repeated once directly after another. parsing should still take rather long in case of real seamless branching movies. but at least we would have gotten rid of parsing rather useless lists. its not really funny not to be able to get out of this parsing loop in explorer other than by task manager.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack) Last edited by Thunderbolt8; 4th October 2011 at 16:37. |
4th October 2011, 18:00 | #1017 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
I'll try to optimize it, and parse each file only once.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
10th October 2011, 20:35 | #1019 | Link |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
http://mediainfo.sourceforge.net/en/Download/Debian
Note: I checked the links in order to be sure they are OK, I just saw that the 64-bit binaries for CLI and GUI package were missing (.so are OK) and nobody warned me... . Updated.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
Thread Tools | Search this Thread |
Display Modes | |
|
|