Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 3 years ago

Closed 2 years ago

Last modified 2 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@… 3 years ago.
latin1.patch (672 bytes) - added by p.kosseff | at \ gmail.com 3 years ago.
fixes the BD player when the path contains non latin chars

Download all attachments as: .zip

Change History (21)

Changed 3 years ago by sandybigboy@…

comment:1 Changed 3 years ago by robertm

  • Status changed from new to infoneeded_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 Changed 3 years ago by sandybigboy@…

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 Changed 3 years ago by robertm

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

comment:4 Changed 3 years ago by markk

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

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 3 years ago by wagnerrp

  • Resolution set to Unverified
  • Status changed from infoneeded_new to 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 3 years ago by p.kosseff | at \ gmail.com

fixes the BD player when the path contains non latin chars

comment:7 Changed 3 years ago by p.kosseff@…

  • Resolution Unverified deleted
  • Status changed from closed to 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:8 follow-up: Changed 3 years ago by p.kosseff@…

just to clarify local 8 bit encoding includes utf8

comment:9 in reply to: ↑ 8 Changed 3 years ago by axboct@…

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

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: Changed 3 years ago by 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.

comment:12 in reply to: ↑ 11 Changed 3 years ago by axboct@…

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

  • Owner robertm deleted
  • Status changed from new to assigned

comment:14 Changed 2 years ago by wagnerrp

  • Status changed from assigned to new

comment:15 Changed 2 years ago by sandybigboy@…

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 2 years ago by stuartm (previous) (diff)

comment:16 Changed 2 years ago by mdean

see, also #10689

comment:17 Changed 2 years ago by Stuart Morgan <smorgan@…>

  • Owner set to Stuart Morgan <smorgan@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 832a3fa71ab9f9ee59f36e03ed7d0503b5718af9/mythtv:

Fix playback of blu-ray ISOs containing UTF8 characters. Fixes #10689, #9797

comment:18 Changed 2 years ago by Stuart Morgan <smorgan@…>

In b221af7e25dd4f354d210a90aa3aae441b59c896/mythtv:

Fix playback of blu-ray ISOs containing UTF8 characters. Fixes #10689, #9797
(cherry picked from commit 832a3fa71ab9f9ee59f36e03ed7d0503b5718af9)

comment:19 Changed 2 years ago by wagnerrp

  • Milestone changed from unknown to 0.25.1

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.