Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenHome renderer question
12-01-2015, 11:59 AM
Post: #8
RE: OpenHome renderer question
(12-01-2015 11:21 AM)simonc Wrote:  My mistake. IdArray just needs to contain a 4 byte big endian unsigned value for each track. Base64 encoding is necessary for communication over UPnP but will be applied automatically if you're using ohNet.

Ah, that makes more sense, good riddance with base64 Smile

(12-01-2015 11:21 AM)simonc Wrote:  In an earlier post, you were concerned whether the use of std::string::c_str() precluded use with binary data that may contain nul bytes. I don't think this is the case.

C++11 section 21.4.7.1 basic_string accessors [string.accessors] says that
const charT* c_str() const noexcept;
Returns: A pointer p such that p + i == &operator[](i) for each i in [0,size()].

which seems to imply that any standards-compliant runtime must have allocated the full contents of a string. The OpenHome::Brn c'tor which is called uses the length provided by the client (std::string::size()) so nul bytes should have no special effect.

You're correct, std::string is happy with null bytes if assign(char*, len) is used as then correct length() is reported.
Just tested it all and everything works fine - Thank You! Smile
Find all posts by this user


Messages In This Thread
OpenHome renderer question - Josef - 10-01-2015, 09:18 PM
RE: OpenHome renderer question - Josef - 11-01-2015, 02:01 PM
RE: OpenHome renderer question - simonc - 11-01-2015, 04:40 PM
RE: OpenHome renderer question - Josef - 11-01-2015, 06:21 PM
RE: OpenHome renderer question - simonc - 11-01-2015, 10:53 PM
RE: OpenHome renderer question - Josef - 11-01-2015, 11:42 PM
RE: OpenHome renderer question - simonc - 12-01-2015, 11:21 AM
RE: OpenHome renderer question - Josef - 12-01-2015 11:59 AM

Forum Jump: