[mythtv] LastFM support in MythMusic

Paul Harrison mythtv at dsl.pipex.com
Tue Feb 26 15:23:26 UTC 2008


Willem Ligtenberg wrote:
> I have created an extra method:
> uint8_t *my_md5(QString string)
> {
>     uint8_t *md5val;
>     uint8_t *c_string = (uint8_t*)string.toUInt();
>     av_md5_sum(md5val, c_string, string.length());
>     return md5val;
> }
>
> And I call this method as follows:
> uint8_t *test = my_md5(authtoken.utf8());
> cout << *test << endl;
>
> Cheers,
>
> Willem
>   

The problem is here:-

uint8_t *c_string = (uint8_t*)string.toUInt();

That converts the string to an unsigned integer what you want is a 
pointer to the data that represents the string. Something like this:

uint8_t *c_string = (uint8_t*)string.ascii();
or
uint8_t *c_string = (uint8_t*)string.local8bit();

should work.

Paul H. 

 



More information about the mythtv-dev mailing list