Skip to content

Commit

Permalink
all: inhibit 'new-buffer' signal before stream unref
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelP committed Mar 19, 2017
1 parent 643f17b commit 867cc05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/arvcameratest.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ main (int argc, char **argv)

arv_camera_stop_acquisition (camera);

arv_stream_set_emit_signals (stream, FALSE);

g_object_unref (stream);
} else
printf ("Can't create stream thread (check if the device is not already used)\n");
Expand Down
3 changes: 3 additions & 0 deletions tests/arvexample.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ main (int argc, char **argv)
/* Stop the video stream */
arv_camera_stop_acquisition (camera);

/* Signal must be inhibited to avoid stream thread running after the last unref */
arv_stream_set_emit_signals (stream, FALSE);

g_object_unref (stream);
} else
printf ("Can't create stream thread (check if the device is not already used)\n");
Expand Down
3 changes: 3 additions & 0 deletions viewer/arvviewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ stop_video (ArvViewer *viewer)
if (GST_IS_PIPELINE (viewer->pipeline))
gst_element_set_state (viewer->pipeline, GST_STATE_NULL);

if (ARV_IS_STREAM (viewer->stream))
arv_stream_set_emit_signals (viewer->stream, FALSE);

g_clear_object (&viewer->stream);
g_clear_object (&viewer->pipeline);

Expand Down

0 comments on commit 867cc05

Please sign in to comment.