Opened 14 years ago
Closed 13 years ago
Last modified 13 years ago
#9797 closed Patch - Bug Fix (fixed)
Play Blu Ray from storage groups with directories whose names contain Cyrillic characters
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 0.25.1 |
Component: | MythTV - Blu-ray Playback | Version: | 0.24-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
This patch makes it possible to play Blu Ray from storage groups, which contain the directories whose names contain Cyrillic characters. This should also work for other characters in the utf8 encoding.
Attachments (2)
Change History (21)
Changed 14 years ago by
Attachment: | libmythtv.diff.tar.gz added |
---|
comment:1 Changed 14 years ago by
Status: | new → infoneeded_new |
---|
comment:2 Changed 14 years ago by
You right, only filename need to convert. I.e. we need only part of patch, from begin to line QByteArray fname = m_dvdFilename.toUtf8(); (inclusive) Should I send a new patch?
comment:4 Changed 14 years ago by
I may be off the mark here, but are you sure the following is safe:-
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
That appears to be changing the global behaviour which I'm guessing may have some unexpected consequences.
Just a thought.
comment:5 Changed 14 years ago by
Mark is right, we can't globally set the text codec, this will break other things. Are the correct UTF-8 locales set on both your frontend and backend?
Robert
comment:6 Changed 14 years ago by
Resolution: | → Unverified |
---|---|
Status: | infoneeded_new → closed |
Closing ticket due to lack of response from reporter. Ticket remains unlocked, and can be re-opened if proper configuration of system 'LANG' does not resolve issue.
Changed 14 years ago by
Attachment: | latin1.patch added |
---|
fixes the BD player when the path contains non latin chars
comment:7 Changed 14 years ago by
Resolution: | Unverified |
---|---|
Status: | closed → new |
The attached patch latin1.patch will fix the BD player issues when the path contains non Latin chars.
The path passed to the bd_open is converted the the local 8 bit encoding.
comment:9 Changed 14 years ago by
Replying to p.kosseff@…:
just to clarify local 8 bit encoding includes utf8
just to clarify .... My local encoding - UTF8 that excludes any 8-bit encoding
comment:10 Changed 14 years ago by
My FE LANG
....@skyworker:~$ echo $LANG ru_UA.UTF-8
My BE LANG
....@mythtv:~$ echo $LANG ru_UA.UTF-8
Logs to demonstrate
libdvdnav: Using dvdnav version svnR1215 libdvdread: Encrypted DVD support unavailable. 2011-08-03 12:02:53.940590 I MythSocket(93c6af8:66): write -> 66 84 QUERY_FILE_EXISTS[]:[]ÐнимаÑиÑ/Shrek/Shrek Forever After/... 2011-08-03 12:02:53.949340 I MythSocket(93c6af8:66): read <- 66 195 1[]:[]/storage/videos/????????/Shrek/Shrek Forever After/VIDEO_TS... 2011-08-03 12:02:53.955420 N SG(Videos): Unable to find any directories for the local storage group 'Videos' on '192.168.5.6', trying directories on all hosts! 2011-08-03 12:02:53.981524 E SG(Videos): FindFile: Unable to find '/Анимация/Shrek/Shrek Forever After'! 2011-08-03 12:02:53.981642 I DVDInfo: Trying myth://Videos@192.168.5.6:6543/Анимация/Shrek/Shrek Forever After 2011-08-03 12:02:53.992707 I MythSocket(93c6af8:66): write -> 66 91 QUERY_FILE_EXISTS[]:[]ÃÂýøüðÃÂøÃÂ/Shrek/Shre... libdvdread: Could not open input: Нет такого файла или каталога libdvdread: Can't open myth://Videos@192.168.5.6:6543/Анимация/Shrek/Shrek Forever After for reading libdvdnav: vm: failed to open/read the DVD 2011-08-03 12:02:54.093939 I MythSocket(93c6af8:66): read <- 66 1 0 2011-08-03 12:02:54.094312 I MythSocket(93c6af8:66): write -> 66 91 QUERY_FILE_EXISTS[]:[]ÃÂýøüðÃÂøÃÂ/Shrek/Shre... 2011-08-03 12:02:54.101150 I MythSocket(93c6af8:66): read <- 66 1 0 2011-08-03 12:02:54.101738 E DVDInfo: Failed to open device at myth://Videos@192.168.5.6:6543/ÐнимаÑиÑ/Shrek/Shrek Forever After 2011-08-03 12:02:54.101773 I DVDInfo: Finishing. 2011-08-03 12:02:55.055307 I MythSocket(93a6d40:67): read <- 67 83 BACKEND_MESSAGE[]:[]UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 24... 2011-08-03 12:02:55.055363 I MythEvent: UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 2411142864 2011-08-03 12:03:05.056901 I MythSocket(93a6d40:67): read <- 67 83 BACKEND_MESSAGE[]:[]UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 24... 2011-08-03 12:03:05.056957 I MythEvent: UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 2424829828 2011-08-03 12:03:15.068637 I MythSocket(93a6d40:67): read <- 67 83 BACKEND_MESSAGE[]:[]UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 24... 2011-08-03 12:03:15.068696 I MythEvent: UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 2435677992 2011-08-03 12:03:25.071403 I MythSocket(93a6d40:67): read <- 67 83 BACKEND_MESSAGE[]:[]UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 24... 2011-08-03 12:03:25.071460 I MythEvent: UPDATE_FILE_SIZE 15101 2011-08-03T11:24:00 2449613868
I'm sorry .... if Cyrillic is not visible then I'll give a screenshot
comment:11 follow-up: 12 Changed 14 years ago by
In my setup the player uses the file system directly which probably changes things :) Also my problems are with BD playback not with DVD and the patch is BD specific.
I'll switch to myth:// scheme tonight to see what happens.
comment:12 Changed 14 years ago by
Replying to p.kosseff@…:
In my setup the player uses the file system directly which probably changes things :) Also my problems are with BD playback not with DVD and the patch is BD specific.
I'll switch to myth:// scheme tonight to see what happens.
It does not matter DVD or BD. To get the file name use the same mechanism
comment:13 Changed 13 years ago by
Owner: | robertm deleted |
---|---|
Status: | new → assigned |
comment:14 Changed 13 years ago by
Status: | assigned → new |
---|
comment:15 Changed 13 years ago by
I must say that I am not a programmer, but I did some experimenting and Google on this topic.
It seems that replacing filename.toLatin1 () on filename.toLocal8Bit () in file BDRingBuffer.cpp (DVDRingBuffer.cpp in the file it is) we will solve the problem, but in reality it is not. As I understand the problem is that outside of the context object QApplication and QCoreApplication Qt does not know about local encoding. And in the code of BDRingBuffer.cpp and DVDRingBuffer.cpp this context is not exists, so we have to explicitly specify the encoding for strings with codecForName. Here's an example:
QApplication app (argc, argv); setlocale (LC_ALL, ""); QTextCodec * vpCodec = QTextCodec :: codecForLocale (); if (vpCodec) { QTextCodec :: setCodecForCStrings (vpCodec); } const QString & filename = "привет!"; QString fn = filename.toLocal8Bit (). Data ();
In this code, the value of variable fn will be appropriate encoding of the locale.
In the code:
QTextCodec * vpCodec = QTextCodec :: codecForLocale (); if (vpCodec) { QTextCodec :: setCodecForCStrings (vpCodec); } const QString & filename = "/ hello"; QString fn = filename.toLocal8Bit (). Data ();
no object QApplication, Qt will use the default encoding, and our code will work only if we specify the codec with, for example QTextCodec :: codecForName ("UTF-8")
Apologize for bad English, and perhaps not the correct terminology
comment:17 Changed 13 years ago by
Owner: | set to Stuart Morgan <smorgan@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:19 Changed 13 years ago by
Milestone: | unknown → 0.25.1 |
---|
Hi,
Thanks for this patch-- There does seem to be an unnecessary hunk-- ISO 639 character codes are always two character latin codes, and never UTF-8... is there a reason you're converting those to UTF-8? I have some concerns about whether or not the functions deeper in bluray's HDMV virtual machine would like to take a UTF-8 string.