Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#9797 closed Patch - Bug Fix (fixed)

Play Blu Ray from storage groups with directories whose names contain Cyrillic characters

Reported by: sandybigboy@… Owned by: Stuart Morgan <smorgan@…>
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)

libmythtv.diff.tar.gz (1.2 KB ) - added by sandybigboy@… 15 years ago.
latin1.patch (672 bytes ) - added by p.kosseff | at \ gmail.com 14 years ago.
fixes the BD player when the path contains non latin chars

Download all attachments as: .zip

Change History (21)

by sandybigboy@…, 15 years ago

Attachment: libmythtv.diff.tar.gz added

comment:1 by robertm, 15 years ago

Status: newinfoneeded_new

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.

comment:2 by sandybigboy@…, 15 years ago

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:3 by robertm, 15 years ago

Sure, update the patch and I'll apply it later.

comment:4 by markk, 15 years ago

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 by robertm, 14 years ago

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 by Raymond Wagner, 14 years ago

Resolution: Unverified
Status: infoneeded_newclosed

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.

by p.kosseff | at \ gmail.com, 14 years ago

Attachment: latin1.patch added

fixes the BD player when the path contains non latin chars

comment:7 by p.kosseff@…, 14 years ago

Resolution: Unverified
Status: closednew

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:8 by p.kosseff@…, 14 years ago

just to clarify local 8 bit encoding includes utf8

in reply to:  8 comment:9 by axboct@…, 14 years ago

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 by axboct@…, 14 years ago

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 by p.kosseff@…, 14 years ago

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.

in reply to:  11 comment:12 by axboct@…, 14 years ago

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 by robertm, 14 years ago

Owner: robertm removed
Status: newassigned

comment:14 by Raymond Wagner, 14 years ago

Status: assignednew

comment:15 by sandybigboy@…, 14 years ago

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

Last edited 14 years ago by stuartm (previous) (diff)

comment:16 by sphery, 14 years ago

see, also #10689

comment:17 by Stuart Morgan <smorgan@…>, 14 years ago

Owner: set to Stuart Morgan <smorgan@…>
Resolution: fixed
Status: newclosed

In 832a3fa71ab9f9ee59f36e03ed7d0503b5718af9/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:18 by Stuart Morgan <smorgan@…>, 14 years ago

In b221af7e25dd4f354d210a90aa3aae441b59c896/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:19 by Raymond Wagner, 14 years ago

Milestone: unknown0.25.1
Note: See TracTickets for help on using tickets.