+ assert(d);
+
+ lock_guard<mutex> lock(d->output_mutex_);
+
+ const Annotation a(pdata);
+
+ // Find the row
+ assert(pdata->pdo);
+ assert(pdata->pdo->di);
+ const srd_decoder *const decc = pdata->pdo->di->decoder;
+ assert(decc);
+
+ auto row_iter = d->rows_.end();
+
+ // Try looking up the sub-row of this class
+ const auto r = d->class_rows_.find(make_pair(decc, a.format()));
+ if (r != d->class_rows_.end())
+ row_iter = d->rows_.find((*r).second);
+ else
+ {
+ // Failing that, use the decoder as a key
+ row_iter = d->rows_.find(Row(decc));
+ }
+
+ assert(row_iter != d->rows_.end());
+ if (row_iter == d->rows_.end()) {
+ qDebug() << "Unexpected annotation: decoder = " << decc <<
+ ", format = " << a.format();
+ assert(0);
+ return;
+ }