name = contents = NULL;
inc->conv_bits.max_bits = 1;
while (parse_section(buf, &name, &contents)) {
sr_dbg("Section '%s', contents '%s'.", name, contents);
if (g_strcmp0(name, "enddefinitions") == 0) {
name = contents = NULL;
inc->conv_bits.max_bits = 1;
while (parse_section(buf, &name, &contents)) {
sr_dbg("Section '%s', contents '%s'.", name, contents);
if (g_strcmp0(name, "enddefinitions") == 0) {
goto done_section;
}
if (g_strcmp0(name, "timescale") == 0) {
if (parse_timescale(inc, contents) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "timescale") == 0) {
if (parse_timescale(inc, contents) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "scope") == 0) {
if (parse_scope(inc, contents, FALSE) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "scope") == 0) {
if (parse_scope(inc, contents, FALSE) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "upscope") == 0) {
if (parse_scope(inc, NULL, TRUE) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "upscope") == 0) {
if (parse_scope(inc, NULL, TRUE) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "var") == 0) {
if (parse_header_var(inc, contents) != SR_OK)
goto done_section;
}
if (g_strcmp0(name, "var") == 0) {
if (parse_header_var(inc, contents) != SR_OK)
/* Send feed header and samplerate (once) before sample data. */
if (!inc->started) {
std_session_send_df_header(in->sdi);
/* Send feed header and samplerate (once) before sample data. */
if (!inc->started) {
std_session_send_df_header(in->sdi);
- count = inc->data_after_timestamp ? 1 : 0;
- add_samples(in, count, TRUE);
+ if (inc->got_header && ret == SR_OK) {
+ count = inc->data_after_timestamp ? 1 : 0;
+ add_samples(in, count, TRUE);
+ }