diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-04 09:56:11 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-03 20:37:10 -0700 |
commit | abed04b3c6d70c260d8725831b8aa6e944f52749 (patch) | |
tree | 4889ef9281c7ee8f7301287fecb2eeb2fc8be873 /host/lib/convert | |
parent | 6c13ef7855dcfe9c825e819f69f219851387da25 (diff) | |
download | uhd-abed04b3c6d70c260d8725831b8aa6e944f52749.tar.gz uhd-abed04b3c6d70c260d8725831b8aa6e944f52749.tar.bz2 uhd-abed04b3c6d70c260d8725831b8aa6e944f52749.zip |
uhd: restored super packet handler functionality
Diffstat (limited to 'host/lib/convert')
-rw-r--r-- | host/lib/convert/convert_impl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp index 2ead2f5b4..5c9e77e93 100644 --- a/host/lib/convert/convert_impl.cpp +++ b/host/lib/convert/convert_impl.cpp @@ -114,6 +114,16 @@ void register_bytes_per_item( size_t convert::get_bytes_per_item(const std::string &markup){ if (get_item_size_table().has_key(markup)) return get_item_size_table()[markup]; + + //OK. I am sorry about this. + //We didnt find a match, so lets find a match for the first term. + //This is partially a hack because of the way I append strings. + //But as long as life is kind, we can keep this. + const size_t pos = markup.find("_"); + if (pos != std::string::npos){ + return get_bytes_per_item(markup.substr(0, pos)); + } + throw uhd::key_error("Cannot find an item size " + markup); } |