예제 #1
0
static void
swfdec_test_swfdec_socket_finish (SwfdecTestPluginSocket *plugin, int error)
{
  SwfdecTestSwfdecSocket *sock = SWFDEC_TEST_SWFDEC_SOCKET_FROM_PLUGIN (plugin);

  if (error) {
    swfdec_stream_error (SWFDEC_STREAM (sock), "error %d", error);
  } else {
    swfdec_stream_close (SWFDEC_STREAM (sock));
  }
  g_object_unref (sock);
}
static NPError 
plugin_destroy_stream_cb (NPP instance, NPStream* stream, NPReason reason)
{
  if (instance == NULL || !SWFMOZ_IS_PLAYER (instance->pdata))
    return NPERR_INVALID_INSTANCE_ERROR;
  if (!SWFMOZ_IS_LOADER (stream->pdata))
    return NPERR_INVALID_INSTANCE_ERROR;

  swfmoz_loader_ensure_open (stream->pdata);
  swfdec_stream_close (stream->pdata);
  SWFMOZ_LOADER (stream->pdata)->stream = NULL;
  if (SWFMOZ_PLAYER (instance->pdata)->initial == stream->pdata)
    SWFMOZ_PLAYER (instance->pdata)->initial = NULL;
  g_object_unref (stream->pdata);
  return NPERR_NO_ERROR;
}