]> sigrok.org Git - libsigrok.git/blobdiff - src/session_driver.c
Virtual session: Workaround for SR_CONF_CAPTUREFILE (#944)
[libsigrok.git] / src / session_driver.c
index 285fa624d326cd47818ad348811f676aa272e7c3..684a7e539122418695be981fcc4fa21a9692172e 100644 (file)
@@ -124,7 +124,17 @@ static gboolean stream_session_data(struct sr_dev_inst *sdi)
                        } else {
                                /* We got all the chunks, finish up. */
                                g_free(vdev->capturefile);
-                               vdev->capturefile = NULL;
+
+                               /* If the file has logic channels, the initial value for
+                                * capturefile is set by stream_session_data() - however only
+                                * once. In order to not mess this mechanism up, we simulate
+                                * this here if needed. For purely analog files, capturefile
+                                * is not set.
+                                */
+                               if (vdev->num_logic_channels)
+                                       vdev->capturefile = g_strdup("logic-1");
+                               else
+                                       vdev->capturefile = NULL;
                                return FALSE;
                        }
                }