本帖最後由 lestari 於 2014-4-24 11:53 編輯

回覆 20# z1022

I modified 'dvb-support.c' only.  As I can't find the solution from Sangood's code, so just make my own patch version.  You said you also modified 'main.c', don't you mind to share it...?

I try Sangood's latest code, but it failed to scan channel in my hardware, this is also reported by ahkeung.  So I can't run and debug Sangood's code, by just 'diff' Sangood's latest code with the main trunk TVheadend latest code, I see no clue how Sangood support Chinese, don't know why.

The reason found is in function dvb_get_string in file dvd_support.c, it didn't handle the source string format identifier 'src[0]', case 0x11, which is used in HK DMB-TH broadcast.

According to the  DVB Broadcast specification EN 300 468.  String format identifier case 0x11 use UTF-16 standard.  Linux core now is UTF-32 and TVheadend use UTF-8.  My modification include 2 conversion stages.

1.  UTF-16 to UTF-32, from DVB standard to Linux core.
2.  UTF-32 to UTF-8, using Linux core library 'wcstombs'.

String format identifier case 0x15 also revised.  Below is the code, sorry my code is ugly...  Please feel free to suggest and comment.

What next (hope) :
1.  Support Chinese channel name.
2.  Support Chinese EPG and channel name is XBMC frontend.
  1.    

  2.   char *tmp;  // declare on top of the function

  3.   case 0x11:
  4.     ic = convert_utf8;
  5.         src++; srclen--;
  6.         tmp = calloc(1, srclen*2+1);
  7.         memset(tmp, 0, srclen*2+1);

  8.         for (i = 0; i < (srclen / 2); i++) {
  9.                 tmp[i*4] = src[i*2+1];
  10.                 tmp[i*4+1] = src[i*2];
  11.         }
  12.        
  13.         len = wcstombs(dst, (const wchar_t *) tmp, srclen*2);
  14.         dst[len] = 0;
  15.         return 0;
  16.     break;

  17.   case 0x12 ... 0x14:
  18.     return -1;

  19.   case 0x15:
  20.     ic = convert_utf8;
  21.         src++; srclen--;
  22.     break;
複製代碼

TOP

回覆  z1022

I modified 'dvb-support.c' only.  As I can't find the solution from Sangood's code, so ...
lestari 發表於 2014-4-24 11:30


Thanks for share your code.

My  C progarmming is very weak.

I just only refer Sangood's version to modify dvb_support.c and main.c file..

It can show Chinese EPG in tvheadend and XMBC.  And the channel name is English.

In the main.c file just only add "#include <iconv.h>"

TOP

本帖最後由 lestari 於 2014-4-24 13:53 編輯

回覆 22# z1022


Hi z1022, I guess my patch is different from Sangood, cause only TVheadend shows Chinese, not XBMC.  I'm wonder the Sangood's latest code may be different from it's previous version, which I'm not able to run, would you mind to e-mail me those two files...?

e-mail : lestari@netvigator.com

Thanks in advance.

TOP

回覆  z1022


Hi z1022, I guess my patch is different from Sangood, cause only TVheadend shows Chin ...
lestari 發表於 2014-4-24 13:51


You can download two file use this link http://www.mediafire.com/download/23c839138052tau/tvheadend.zip

Or full source in this link http://www.mediafire.com/download/cxwqhl36gek5awp/tvheadend.tar


My NAS need to preload : preloadable_libiconv.so to scan the channel.

http://www.linuxidc.com/Linux/2012-01/51165.htm
https://www.gnu.org/software/libiconv/

TOP

本帖最後由 lestari 於 2014-4-25 11:16 編輯

回覆 24# z1022

Wow...  Thanks a lot.  Sangood patch is much better, also handle the Simplified Chinese as well.

So strange that last time I download the latest Sangood's source from https://github.com/sangood/tvheadend, but the Chinese Patch is gone...!

Current status:
TVheadend, good.  Latest trunk version with Sangood's patch.  Able to show Chinese EPG, for channel name, manual edit to Chinese in 'Configuration --> Channel / EPG  --> Channels', cause it seldom change.



Edit the channel name



XBMC 13.0-Beta4.  Has two problems on Chinese, no matter set to Simplified or Tranditional Chinese in 'System --> Setting -->Appearance --> International --> Character Set'.
1.  Channel name and Timer show Chinese, but not the EPG...!
2.  Number of Channels is 14 in Channel List, but only 8 in EGP mode.  Some channels are missing...!

14 Chinese channels


Timer in Chinese


Only 8 channels, EPG in English...!
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

TOP

本帖最後由 ahkeung 於 2014-4-25 11:16 編輯
回覆  z1022

Wow...  Thanks a lot.  Sangood patch is much better, also handle the Simplified Chines ...
lestari 發表於 2014-4-25 11:02


Good. I found that the Sangood patch was only kept on the old version.

After read z1022, I also tried to modify the 3.9 version original code. It works. But I found that the webui live player must transcode the video to lower resolution and no sound.  therefore I go back to 3.4 version.

(The full source link from z1022 http://www.mediafire.com/download/cxwqhl36gek5awp/tvheadend.tar is in 3.4 version. or I got incorrect configuration?)

TOP

Good. I found that the Sangood patch was only kept on the old version.

After read z1022, I also  ...
ahkeung 發表於 2014-4-25 11:14


You are right.  The source is incorrect.

TOP

Hi, ahkeung and z1022, I would like to try the Sangood's old full version, can you share with me...?

TOP

Hi, ahkeung and z1022, I would like to try the Sangood's old full version, can you share with me...?
lestari 發表於 2014-4-25 12:54


Here  https://github.com/sangood/tvheadend/tree/v3.4path1-gb2312

TOP

Good. I found that the Sangood patch was only kept on the old version.

After read z1022, I also  ...
ahkeung 發表於 2014-4-25 11:14


How do you check the video resolution ?

I can play with sound.

Did you enable the sound ?
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

TOP