static gboolean
gst_aasink_open (GstAASink * aasink)
{
- aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
-
- aasink->context = aa_autoinit (&aasink->ascii_surf);
- if (aasink->context == NULL) {
- GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL),
- ("error opening aalib context"));
- return FALSE;
+ if (!aasink->context) {
+ aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
+
+ aasink->context = aa_autoinit (&aasink->ascii_surf);
+ if (aasink->context == NULL) {
+ GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL),
+ ("error opening aalib context"));
+ return FALSE;
+ }
+ aa_autoinitkbd (aasink->context, 0);
+ aa_resizehandler (aasink->context, (void *) aa_resize);
}
- aa_autoinitkbd (aasink->context, 0);
- aa_resizehandler (aasink->context, (void *) aa_resize);
-
return TRUE;
}
gst_aasink_close (GstAASink * aasink)
{
aa_close (aasink->context);
+ aasink->context = NULL;
return TRUE;
}